Skip to content

Commit

Permalink
[squash] apply fix to BufferList
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed May 26, 2017
1 parent 5692736 commit 6573670
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/internal/streams/BufferList.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

const Buffer = require('buffer').Buffer;

function copyBuffer(src, target, offset) {
Buffer.prototype.copy.call(src, target, offset);
}

module.exports = class BufferList {
constructor() {
this.head = null;
Expand Down Expand Up @@ -63,7 +67,7 @@ module.exports = class BufferList {
var p = this.head;
var i = 0;
while (p) {
p.data.copy(ret, i);
copyBuffer(p.data, ret, i);
i += p.data.length;
p = p.next;
}
Expand Down

0 comments on commit 6573670

Please sign in to comment.