mirror of
https://github.com/denoland/deno.git
synced 2025-01-03 04:48:52 -05:00
perf(ext/headers): use .push loop instead of spread operator (#20108)
This commit is contained in:
parent
08109b1d86
commit
414274b68a
1 changed files with 6 additions and 5 deletions
|
@ -31,7 +31,6 @@ const {
|
||||||
ObjectEntries,
|
ObjectEntries,
|
||||||
ObjectHasOwn,
|
ObjectHasOwn,
|
||||||
RegExpPrototypeExec,
|
RegExpPrototypeExec,
|
||||||
SafeArrayIterator,
|
|
||||||
SafeMap,
|
SafeMap,
|
||||||
MapPrototypeGet,
|
MapPrototypeGet,
|
||||||
MapPrototypeHas,
|
MapPrototypeHas,
|
||||||
|
@ -262,11 +261,13 @@ class Headers {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const entries = ObjectEntries(headers);
|
||||||
|
for (let i = 0; i < cookies.length; ++i) {
|
||||||
|
ArrayPrototypePush(entries, cookies[i]);
|
||||||
|
}
|
||||||
|
|
||||||
return ArrayPrototypeSort(
|
return ArrayPrototypeSort(
|
||||||
[
|
entries,
|
||||||
...new SafeArrayIterator(ObjectEntries(headers)),
|
|
||||||
...new SafeArrayIterator(cookies),
|
|
||||||
],
|
|
||||||
(a, b) => {
|
(a, b) => {
|
||||||
const akey = a[0];
|
const akey = a[0];
|
||||||
const bkey = b[0];
|
const bkey = b[0];
|
||||||
|
|
Loading…
Reference in a new issue