diff options
author | Marcos Casagrande <marcoscvp90@gmail.com> | 2023-08-10 01:36:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-09 19:36:47 -0400 |
commit | 414274b68a80199c3fb6bfb3890b0afb79f5b7f9 (patch) | |
tree | af017c6ca2734e6ed419677b3b8ae16a991bce84 /ext/fetch/20_headers.js | |
parent | 08109b1d86dfce0471fa87a685717036274f0877 (diff) |
perf(ext/headers): use .push loop instead of spread operator (#20108)
Diffstat (limited to 'ext/fetch/20_headers.js')
-rw-r--r-- | ext/fetch/20_headers.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/fetch/20_headers.js b/ext/fetch/20_headers.js index bea542c30..45bd29ad3 100644 --- a/ext/fetch/20_headers.js +++ b/ext/fetch/20_headers.js @@ -31,7 +31,6 @@ const { ObjectEntries, ObjectHasOwn, RegExpPrototypeExec, - SafeArrayIterator, SafeMap, MapPrototypeGet, 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( - [ - ...new SafeArrayIterator(ObjectEntries(headers)), - ...new SafeArrayIterator(cookies), - ], + entries, (a, b) => { const akey = a[0]; const bkey = b[0]; |