stream: remove unreachable code
To avoid a function call `BufferList.prototype.concat()` is not called when there is only a buffer in the list. That buffer is instead accessed directly. PR-URL: https://github.com/nodejs/node/pull/18239 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
parent
e65a6e81ef
commit
80b3acca07
@ -62,8 +62,6 @@ module.exports = class BufferList {
|
||||
concat(n) {
|
||||
if (this.length === 0)
|
||||
return Buffer.alloc(0);
|
||||
if (this.length === 1)
|
||||
return this.head.data;
|
||||
const ret = Buffer.allocUnsafe(n >>> 0);
|
||||
var p = this.head;
|
||||
var i = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user