Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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: #18239
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information
lpinca committed Mar 20, 2018
commit 95abb998ad21643837e8482a421279e0c7d1099a
2 changes: 0 additions & 2 deletions lib/internal/streams/BufferList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down