diff options
author | 陈刚 <chengang07@meituan.com> | 2018-01-21 16:13:14 +0800 |
---|---|---|
committer | Matteo Collina <hello@matteocollina.com> | 2018-02-02 23:00:50 +0100 |
commit | f0b2dd31cebceca42b0e41ba2ecf843b3578bf87 (patch) | |
tree | c1b29de03d476afbd4ce70f4e0ae934ae3171c33 /lib/_stream_transform.js | |
parent | d2a6110d3fa78ef6680a9ef5faa279a4f35f486c (diff) | |
download | node-new-f0b2dd31cebceca42b0e41ba2ecf843b3578bf87.tar.gz |
stream: delete unused code
In implementation of `stream.Writable`, `writable._write()` is
always called with a callback that is `_writableState.onwrite()`.
And In `afterTransform()`, `ts.writechunk` and `ts.writecb` are
assigned to null. So, `ts.writecb` is a true value if
`ts.writechunk` isn't null.
PR-URL: https://github.com/nodejs/node/pull/18278
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/_stream_transform.js')
-rw-r--r-- | lib/_stream_transform.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js index b8d4a7704a..a9fcddda2d 100644 --- a/lib/_stream_transform.js +++ b/lib/_stream_transform.js @@ -180,7 +180,7 @@ Transform.prototype._write = function(chunk, encoding, cb) { Transform.prototype._read = function(n) { var ts = this._transformState; - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + if (ts.writechunk !== null && !ts.transforming) { ts.transforming = true; this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { |