summaryrefslogtreecommitdiff
path: root/ext/fetch/20_headers.js
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2023-01-06 21:45:23 +0900
committerGitHub <noreply@github.com>2023-01-06 21:45:23 +0900
commitff89ff4abba39ce158056d390e761495f5a7bc86 (patch)
tree03a9c71b5bb3889842db06ed41c3999074c4107a /ext/fetch/20_headers.js
parent39cbaa6d34c249afc4b197836da1fa6dd143cbf9 (diff)
perf(ext,runtime): remove using `SafeArrayIterator` from `for-of` (#17255)
Diffstat (limited to 'ext/fetch/20_headers.js')
-rw-r--r--ext/fetch/20_headers.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/fetch/20_headers.js b/ext/fetch/20_headers.js
index a2fae2cfe..54e635522 100644
--- a/ext/fetch/20_headers.js
+++ b/ext/fetch/20_headers.js
@@ -68,7 +68,8 @@
*/
function fillHeaders(headers, object) {
if (ArrayIsArray(object)) {
- for (const header of new SafeArrayIterator(object)) {
+ for (let i = 0; i < object.length; ++i) {
+ const header = object[i];
if (header.length !== 2) {
throw new TypeError(
`Invalid header. Length must be 2, but is ${header.length}`,
@@ -205,7 +206,8 @@
// spec but produce the same result.
const headers = {};
const cookies = [];
- for (const entry of new SafeArrayIterator(list)) {
+ for (let i = 0; i < list.length; ++i) {
+ const entry = list[i];
const name = byteLowerCase(entry[0]);
const value = entry[1];
if (value === null) throw new TypeError("Unreachable");