Skip to content

Commit

Permalink
stream: remove dead code
Browse files Browse the repository at this point in the history
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 10, 2019
1 parent 2a51ae4 commit 1a67c99
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 1a67c99

Please sign in to comment.