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 <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yongsheng Zhang <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
  • 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.