Skip to content

Commit

Permalink
stream: remove duplicated expression
Browse files Browse the repository at this point in the history
PR-URL: nodejs#1444
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
  • Loading branch information
yorkie authored and Fishrock123 committed Apr 16, 2015
1 parent 3ad82c3 commit 51d0808
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,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');
Expand Down Expand Up @@ -372,7 +371,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);
Expand Down

0 comments on commit 51d0808

Please sign in to comment.