Skip to content

Commit

Permalink
perf: avoid buffer cloning (#3264)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsctx authored May 15, 2024
1 parent e2dc4da commit 0980f9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/web/fetch/body.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ function bodyMixinMethods (instance) {
// with this and the following step given a byte sequence bytes: return the
// result of creating a Uint8Array from bytes in this’s relevant realm.
return consumeBody(this, (bytes) => {
return new Uint8Array(bytes)
return new Uint8Array(bytes.buffer, 0, bytes.byteLength)
}, instance, true)
}
}
Expand Down

0 comments on commit 0980f9d

Please sign in to comment.