Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
陈刚 committed Jan 21, 2018
commit d3aba3e2caa1f0ab3f46b067a173a2eab21f1baa
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