stream: remove unreachable code by lpinca · Pull Request #18239 · nodejs/node

added 2 commits

January 18, 2018 18:39
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.
The `n` argument of `BufferList.prototype.concat()` is not the number
of `Buffer` instances in the list, but their total length when
concatenated.

@lpinca lpinca added stream

Issues and PRs related to the stream subsystem.

test

Issues and PRs related to the tests.

labels

Jan 18, 2018

lpinca

mcollina

lpinca added a commit that referenced this pull request

Jan 24, 2018
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>

lpinca added a commit that referenced this pull request

Jan 24, 2018
The `n` argument of `BufferList.prototype.concat()` is not the number
of `Buffer` instances in the list, but their total length when
concatenated.

PR-URL: #18239
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

@lpinca lpinca deleted the remove/unreachable-code branch

January 24, 2018 15:32

evanlucas pushed a commit that referenced this pull request

Jan 30, 2018
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>

evanlucas pushed a commit that referenced this pull request

Jan 30, 2018
The `n` argument of `BufferList.prototype.concat()` is not the number
of `Buffer` instances in the list, but their total length when
concatenated.

PR-URL: #18239
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

This was referenced

Apr 7, 2024

This was referenced

Apr 7, 2024

This was referenced

Apr 7, 2024

This was referenced

Apr 7, 2024

This was referenced

Apr 8, 2024

This was referenced

Oct 21, 2024