Skip to content

Commit

Permalink
stream: delete unused code
Browse files Browse the repository at this point in the history
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: #18278
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
陈刚 authored and mcollina committed Feb 2, 2018
1 parent d2a6110 commit f0b2dd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/_stream_transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit f0b2dd3

Please sign in to comment.