diff --git a/lib/internal/streams/buffer_list.js b/lib/internal/streams/buffer_list.js index e0ba6e885cb60e..5bfa762e85d0a6 100644 --- a/lib/internal/streams/buffer_list.js +++ b/lib/internal/streams/buffer_list.js @@ -3,10 +3,6 @@ const { Buffer } = require('buffer'); const { inspect } = require('internal/util/inspect'); -function copyBuffer(src, target, offset) { - Buffer.prototype.copy.call(src, target, offset); -} - module.exports = class BufferList { constructor() { this.head = null; @@ -66,7 +62,7 @@ module.exports = class BufferList { var p = this.head; var i = 0; while (p) { - copyBuffer(p.data, ret, i); + ret.set(p.data, i); i += p.data.length; p = p.next; }