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:
陈刚 authored and Myles Borins committed 2018-02-21 10:19:05 -05:00
1 parent 58003d4ddf
commit 560f657957
1 file changed
+1 -2
+1 -2
View File
@@ -307,7 +307,6 @@ Writable.prototype.uncork = function() {
if (!state.writing &&
!state.corked &&
!state.finished &&
!state.bufferProcessing &&
state.bufferedRequest)
clearBuffer(this, state);
@@ -579,7 +578,7 @@ Writable.prototype.end = function(chunk, encoding, cb) {
}
// ignore unnecessary end() calls.
if (!state.ending && !state.finished)
if (!state.ending)
endWritable(this, state, cb);
};