From 6d8f6d5af09a5e78bed9bf04fa2e0970c0eb5a9f Mon Sep 17 00:00:00 2001 From: Andrew Johnston Date: Sun, 11 Sep 2022 04:10:06 +0100 Subject: perf(url): return early if url has no query string (#15856) --- ext/url/00_url.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ext/url/00_url.js') diff --git a/ext/url/00_url.js b/ext/url/00_url.js index 659e6a37b..5479cb59c 100644 --- a/ext/url/00_url.js +++ b/ext/url/00_url.js @@ -92,6 +92,11 @@ { prefix, context: "Argument 1" }, ); this[webidl.brand] = webidl.brand; + if (!init) { + // if there is no query string, return early + this[_list] = []; + return; + } if (typeof init === "string") { // Overload: USVString -- cgit v1.2.3