From 92bfe9ae4f95b0d43cd5d7a0e0ffb56a4b166fe8 Mon Sep 17 00:00:00 2001 From: Roberto Bianchi Date: Thu, 5 Nov 2026 10:50:20 +0100 Subject: [PATCH] url: use indexed appends in search params getAll MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use indexed writes when collecting matching parameter values. This improves getAll throughput without changing result order. Signed-off-by: Roberto Bianchi PR-URL: https://github.com/nodejs/node/pull/66872 Reviewed-By: Gürgün Dayıoğlu --- lib/internal/url.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;