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 Matteo Collina committed 2018-02-02 10:14:34 +01:00
1 parent caa26cbf13
commit ce83099d3e
1 file changed
+1 -2
+1 -2
View File
@@ -297,7 +297,6 @@ Writable.prototype.uncork = function() {
if (!state.writing &&
!state.corked &&
!state.finished &&
!state.bufferProcessing &&
state.bufferedRequest)
clearBuffer(this, state);
@@ -569,7 +568,7 @@ Writable.prototype.end = function(chunk, encoding, cb) {
}
// ignore unnecessary end() calls.
if (!state.ending && !state.finished)
if (!state.ending)
endWritable(this, state, cb);
};