diff options
author | 陈刚 <chengang07@meituan.com> | 2018-01-14 23:34:18 +0800 |
---|---|---|
committer | Matteo Collina <hello@matteocollina.com> | 2018-02-02 10:14:34 +0100 |
commit | ce83099d3e6f6d7be0e533c19cd7f905bba4ea2a (patch) | |
tree | 73b9d8afb734132da3fccb656c5508436ca365aa /lib/_stream_writable.js | |
parent | caa26cbf135fbf7d0f3306a880762b10ff9cf299 (diff) | |
download | android-node-v8-ce83099d3e6f6d7be0e533c19cd7f905bba4ea2a.tar.gz android-node-v8-ce83099d3e6f6d7be0e533c19cd7f905bba4ea2a.tar.bz2 android-node-v8-ce83099d3e6f6d7be0e533c19cd7f905bba4ea2a.zip |
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>
Diffstat (limited to 'lib/_stream_writable.js')
-rw-r--r-- | lib/_stream_writable.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js index 154c87bf5c..33c680cb5b 100644 --- a/lib/_stream_writable.js +++ b/lib/_stream_writable.js @@ -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); }; |