summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
author陈刚 <chengang07@meituan.com>2018-01-21 16:13:14 +0800
committerMatteo Collina <hello@matteocollina.com>2018-02-02 23:00:50 +0100
commitf0b2dd31cebceca42b0e41ba2ecf843b3578bf87 (patch)
treec1b29de03d476afbd4ce70f4e0ae934ae3171c33 /lib
parentd2a6110d3fa78ef6680a9ef5faa279a4f35f486c (diff)
downloadandroid-node-v8-f0b2dd31cebceca42b0e41ba2ecf843b3578bf87.tar.gz
android-node-v8-f0b2dd31cebceca42b0e41ba2ecf843b3578bf87.tar.bz2
android-node-v8-f0b2dd31cebceca42b0e41ba2ecf843b3578bf87.zip
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')
-rw-r--r--lib/_stream_transform.js2
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 {