stream: remove dead code
This condition could never be met because all calling functions guarded against this. PR-URL: https://github.com/nodejs/node/pull/15665 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
9910860a93
commit
4536128e7c
@ -1040,11 +1040,6 @@ function copyFromBuffer(n, list) {
|
|||||||
function endReadable(stream) {
|
function endReadable(stream) {
|
||||||
var state = stream._readableState;
|
var state = stream._readableState;
|
||||||
|
|
||||||
// If we get here before consuming all the bytes, then that is a
|
|
||||||
// bug in node. Should never happen.
|
|
||||||
if (state.length > 0)
|
|
||||||
throw new Error('"endReadable()" called on non-empty stream');
|
|
||||||
|
|
||||||
if (!state.endEmitted) {
|
if (!state.endEmitted) {
|
||||||
state.ended = true;
|
state.ended = true;
|
||||||
process.nextTick(endReadableNT, state, stream);
|
process.nextTick(endReadableNT, state, stream);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user