Skip to content
Permalink
Browse files

stream: remove dead code

Remove unreachable code. `state.ended` is always set to true
in this part of the code. The `else` clause can't be executed.

PR-URL: #27125
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information...
marcosc90 authored and BridgeAR committed Apr 7, 2019
1 parent 2a51ae4 commit 1a67c9948c005b7d1f8a7fc128e7530078da5c2c
Showing with 1 addition and 5 deletions.
  1. +1 −5 lib/_stream_readable.js
@@ -521,11 +521,7 @@ function onEofChunk(stream, state) {
state.emittedReadable = true;
// We have to emit readable now that we are EOF. Modules
// in the ecosystem (e.g. dicer) rely on this event being sync.
if (state.ended) {
emitReadable_(stream);
} else {
process.nextTick(emitReadable_, stream);
}
emitReadable_(stream);
}
}

0 comments on commit 1a67c99

Please sign in to comment.
You can’t perform that action at this time.