Skip to content

Commit d8ceae6

Browse files
committed
feedback
1 parent 07a4b40 commit d8ceae6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/internal/url.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -495,12 +495,12 @@ class URLSearchParams {
495495

496496
const list = this.#searchParams;
497497
name = StringPrototypeToWellFormed(`${name}`);
498-
const len = list.length;
498+
const { length } = list;
499499
let write = 0;
500500

501501
if (value !== undefined) {
502502
value = StringPrototypeToWellFormed(`${value}`);
503-
for (let i = 0; i < len; i += 2) {
503+
for (let i = 0; i < length; i += 2) {
504504
if (list[i] === name && list[i + 1] === value) {
505505
continue;
506506
}
@@ -511,7 +511,7 @@ class URLSearchParams {
511511
write += 2;
512512
}
513513
} else {
514-
for (let i = 0; i < len; i += 2) {
514+
for (let i = 0; i < length; i += 2) {
515515
if (list[i] === name) {
516516
continue;
517517
}
@@ -523,7 +523,7 @@ class URLSearchParams {
523523
}
524524
}
525525

526-
if (write !== len)
526+
if (write !== length)
527527
list.length = write;
528528

529529
if (this.#context) {
@@ -605,14 +605,14 @@ class URLSearchParams {
605605
const list = this.#searchParams;
606606
name = StringPrototypeToWellFormed(`${name}`);
607607
value = StringPrototypeToWellFormed(`${value}`);
608-
const len = list.length;
608+
const { length } = list;
609609

610610
// If there are any name-value pairs whose name is `name`, in `list`, set
611611
// the value of the first such name-value pair to `value` and remove the
612612
// others.
613613
let found = false;
614614
let write = 0;
615-
for (let i = 0; i < len; i += 2) {
615+
for (let i = 0; i < length; i += 2) {
616616
const cur = list[i];
617617
let keep = true;
618618
if (cur === name) {
@@ -631,7 +631,7 @@ class URLSearchParams {
631631
write += 2;
632632
}
633633

634-
if (found && write !== len) {
634+
if (found && write !== length) {
635635
list.length = write;
636636
}
637637

0 commit comments

Comments
 (0)