Skip to content

Commit 0980f9d

Browse files
authored
perf: avoid buffer cloning (#3264)
1 parent e2dc4da commit 0980f9d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/web/fetch/body.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ function bodyMixinMethods (instance) {
392392
// with this and the following step given a byte sequence bytes: return the
393393
// result of creating a Uint8Array from bytes in this’s relevant realm.
394394
return consumeBody(this, (bytes) => {
395-
return new Uint8Array(bytes)
395+
return new Uint8Array(bytes.buffer, 0, bytes.byteLength)
396396
}, instance, true)
397397
}
398398
}

0 commit comments

Comments
 (0)