Skip to content

Commit

Permalink
stream: improve read() performance
Browse files Browse the repository at this point in the history
PR-URL: #28961
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
mscdex authored and targos committed Aug 19, 2019
1 parent b7696b4 commit 000999c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/internal/streams/buffer_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 000999c

Please sign in to comment.