From d9711ef9e33f8644a4cb19ebeae6a81d4c0e3fa2 Mon Sep 17 00:00:00 2001 From: Marcos Casagrande Date: Sun, 7 Apr 2019 17:28:03 -0300 Subject: [PATCH] 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. --- lib/_stream_readable.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 43b5b43fc77a5e..ec4c9d363187ba 100644 --- a/lib/_stream_readable.js +++ b/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); } }