Commit 1c07ebfd authored by Miklos Suveges's avatar Miklos Suveges Committed by Matteo Collina
Browse files

stream: inline needMoreData function

Inline the needMoreData function since it has only one call place.
Update the related comment.
Add a test for the edge case where HWM=0 and state.length=0.
Add a test for ReadableStream.read(n) method's edge case where
n, HWM and state.length are all zero.
This proves that there is no easy way to simplify the check at
https://github.com/nodejs/node/blob/master/lib/_stream_readable.js#L440

Fixes: https://github.com/nodejs/node/issues/19893
Refs: https://github.com/nodejs/node/pull/19896

PR-URL: https://github.com/nodejs/node/pull/21009


Reviewed-By: default avatarMatteo Collina <matteo.collina@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarLance Ball <lball@redhat.com>
Reviewed-By: default avatarTrivikram Kamat <trivikr.dev@gmail.com>
parent f86e5fc4
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment