Skip to content

Commit 57caad4

Browse files
committed
small perf improvement
1 parent f52dffd commit 57caad4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,9 @@ Buffer.concat = function concat (list, length) {
410410
let buf = list[i]
411411
if (isInstance(buf, Uint8Array)) {
412412
if (pos + buf.length > buffer.length) {
413-
if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)
413+
if (!Buffer.isBuffer(buf)) {
414+
buf = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)
415+
}
414416
buf.copy(buffer, pos)
415417
} else {
416418
Uint8Array.prototype.set.call(

0 commit comments

Comments
 (0)