mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
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. Backport-PR-URL: https://github.com/nodejs/node/pull/19483 PR-URL: https://github.com/nodejs/node/pull/18239 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
1 parent
49d8c2e8ae
commit
8f830ca896
1 file changed
-2
@@ -58,8 +58,6 @@ BufferList.prototype.join = function(s) {
|
||||
BufferList.prototype.concat = function(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;
|
||||
|
||||
Reference in new issue
Block a user