Skip to content

Commit a4cc0fb

Browse files
陈刚MylesBorins
authored andcommitted
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: #18278 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 9af1e4b commit a4cc0fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎lib/_stream_transform.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Transform.prototype._write = function(chunk, encoding, cb){
180180
Transform.prototype._read=function(n){
181181
varts=this._transformState;
182182

183-
if(ts.writechunk!==null&&ts.writecb&&!ts.transforming){
183+
if(ts.writechunk!==null&&!ts.transforming){
184184
ts.transforming=true;
185185
this._transform(ts.writechunk,ts.writeencoding,ts.afterTransform);
186186
}else{

0 commit comments

Comments
(0)