Commit 8337f973de8 for nodejs
commit 8337f973de8e45a4b3720891454b033374a2f1e4
Author: Roberto Bianchi <roberto.bianchi@spendesk.com>
Date: Thu Nov 5 10:50:20 2026 +0100
url: use indexed appends in search params getAll
Use indexed writes when collecting matching parameter values.
This improves getAll throughput without changing result order.
Signed-off-by: Roberto Bianchi <roberto.bianchi@spendesk.com>
PR-URL: https://github.com/nodejs/node/pull/66872
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
diff --git a/lib/internal/url.js b/lib/internal/url.js
index 456afd2242d..0fe819fe129 100644
--- a/lib/internal/url.js
+++ b/lib/internal/url.js
@@ -624,7 +624,7 @@ class URLSearchParams {
const { length } = list;
for (let i = 0; i < length; i += 2) {
if (list[i] === name) {
- ArrayPrototypePush(values, list[i + 1]);
+ values[values.length] = list[i + 1];
}
}
return values;