diff options
author | Marcos Casagrande <marcoscvp90@gmail.com> | 2022-10-03 13:34:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-03 13:34:13 +0200 |
commit | d13c88e70de9b3fd61c526ead90716fac503deed (patch) | |
tree | c8e146fd5dc0da73481399d83552cd127df88492 /ext/fetch/23_response.js | |
parent | 7a7767262a3b373cc9a3f6260a8ebd45da7edd1c (diff) |
refactor(ext/fetch): avoid extra headers copy in .clone (#16130)
Diffstat (limited to 'ext/fetch/23_response.js')
-rw-r--r-- | ext/fetch/23_response.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ext/fetch/23_response.js b/ext/fetch/23_response.js index 3c19f963a..d5adb8042 100644 --- a/ext/fetch/23_response.js +++ b/ext/fetch/23_response.js @@ -97,11 +97,11 @@ */ function cloneInnerResponse(response) { const urlList = [...new SafeArrayIterator(response.urlList)]; - const headerList = [ - ...new SafeArrayIterator( - ArrayPrototypeMap(response.headerList, (x) => [x[0], x[1]]), - ), - ]; + const headerList = ArrayPrototypeMap( + response.headerList, + (x) => [x[0], x[1]], + ); + let body = null; if (response.body !== null) { body = response.body.clone(); |