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: https://github.com/nodejs/node/pull/18145 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This commit is contained in:
parent
caa26cbf13
commit
ce83099d3e
@ -297,7 +297,6 @@ Writable.prototype.uncork = function() {
|
|||||||
|
|
||||||
if (!state.writing &&
|
if (!state.writing &&
|
||||||
!state.corked &&
|
!state.corked &&
|
||||||
!state.finished &&
|
|
||||||
!state.bufferProcessing &&
|
!state.bufferProcessing &&
|
||||||
state.bufferedRequest)
|
state.bufferedRequest)
|
||||||
clearBuffer(this, state);
|
clearBuffer(this, state);
|
||||||
@ -569,7 +568,7 @@ Writable.prototype.end = function(chunk, encoding, cb) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ignore unnecessary end() calls.
|
// ignore unnecessary end() calls.
|
||||||
if (!state.ending && !state.finished)
|
if (!state.ending)
|
||||||
endWritable(this, state, cb);
|
endWritable(this, state, cb);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user