GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||
GeezerVison is showing github.com — stream: remove unreachable code by lpinca · Pull Request #18239 · nodejs/node Conversation
Member
First commit remove some unreachable code. Second commit fixes a test. Checklist
Affected core subsystem(s)stream, test
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
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.
|
There was an error while loading. Please reload this page.
|
It's better to modify |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@MoonBall The |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
ok. I agree. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
/cc @nodejs/streams |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm not super comfortable with this change. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Do you mean if |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Can you restore the test then? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| const copy = list.concat(3); | ||
|
|
||
| assert.strictEqual(list.concat(1), 'foo'); |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@mcollina this is wrong whether or not the change in BufferList.js is applied.
concat() only works with buffers.n argument (1) was wrong and irrelevant. You could have used any argument and the test would have still passed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
FWIW the fixed test actually tests the impossible case where |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM, perfect
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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 <[email protected]>
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 <[email protected]>
|
Landed in e65a6e8...2313424. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
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 <[email protected]>
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 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.