Skip to content

Commit 6d8f6d5

Browse files
authored
perf(url): return early if url has no query string (denoland#15856)
1 parent dee9f0a commit 6d8f6d5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ext/url/00_url.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@
9292
{ prefix, context: "Argument 1" },
9393
);
9494
this[webidl.brand] = webidl.brand;
95+
if (!init) {
96+
// if there is no query string, return early
97+
this[_list] = [];
98+
return;
99+
}
95100

96101
if (typeof init === "string") {
97102
// Overload: USVString

0 commit comments

Comments
 (0)