Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

stream: remove duplicated expression

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
  • Loading branch information...
commit cfcb1de130867197cbc9c6012b7e84e08e53d032 1 parent 25702ab
@yorkie yorkie authored chrisdickinson committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/_stream_readable.js
View
6 lib/_stream_readable.js
@@ -141,8 +141,7 @@ function readableAddChunk(stream, state, chunk, encoding, addToFront) {
stream.emit('error', er);
} else if (chunk === null) {
state.reading = false;
- if (!state.ended)
- onEofChunk(stream, state);
+ onEofChunk(stream, state);
} else if (state.objectMode || chunk && chunk.length > 0) {
if (state.ended && !addToFront) {
var e = new Error('stream.push() after EOF');
@@ -387,7 +386,8 @@ function chunkInvalid(state, chunk) {
function onEofChunk(stream, state) {
- if (state.decoder && !state.ended) {
+ if (state.ended) return;
+ if (state.decoder) {
var chunk = state.decoder.end();
if (chunk && chunk.length) {
state.buffer.push(chunk);
Please sign in to comment.
Something went wrong with that request. Please try again.