Skip to content
Permalink
Browse files

stream: improve read() performance

PR-URL: #28961
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
mscdex authored and targos committed Aug 4, 2019
1 parent b7696b4 commit 000999c06c91dd40532efa0fc7c67edd1bf2e7c2
Showing with 1 addition and 5 deletions.
  1. +1 −5 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;
}

0 comments on commit 000999c

Please sign in to comment.
You can’t perform that action at this time.