Skip to content

Commit ce83099

Browse files
陈刚mcollina
authored andcommitted
stream: delete redundant code
In `Writable.prototype.end()`, `state.ending` is true after calling `endWritable()` and it doesn't reset to false. In `Writable.prototype.uncork()`, `state.finished` must be false if `state.bufferedRequest` is true. PR-URL: #18145 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent caa26cb commit ce83099

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/_stream_writable.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ Writable.prototype.uncork = function() {
297297

298298
if (!state.writing &&
299299
!state.corked &&
300-
!state.finished &&
301300
!state.bufferProcessing &&
302301
state.bufferedRequest)
303302
clearBuffer(this, state);
@@ -569,7 +568,7 @@ Writable.prototype.end = function(chunk, encoding, cb) {
569568
}
570569

571570
// ignore unnecessary end() calls.
572-
if (!state.ending && !state.finished)
571+
if (!state.ending)
573572
endWritable(this, state, cb);
574573
};
575574

0 commit comments

Comments
 (0)