Skip to content

Commit 560f657

Browse files
陈刚MylesBorins
陈刚
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 58003d4 commit 560f657

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/_stream_writable.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ Writable.prototype.uncork = function() {
307307

308308
if (!state.writing &&
309309
!state.corked &&
310-
!state.finished &&
311310
!state.bufferProcessing &&
312311
state.bufferedRequest)
313312
clearBuffer(this, state);
@@ -579,7 +578,7 @@ Writable.prototype.end = function(chunk, encoding, cb) {
579578
}
580579

581580
// ignore unnecessary end() calls.
582-
if (!state.ending && !state.finished)
581+
if (!state.ending)
583582
endWritable(this, state, cb);
584583
};
585584

0 commit comments

Comments
 (0)