Skip to content

Commit c4decd7

Browse files
ronagTrott
authored andcommitted
stream: fix Writable.destroy performance regression
Ref: #50409 PR-URL: #50478 Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent 3daa0a6 commit c4decd7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎lib/internal/streams/writable.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ Writable.prototype.destroy = function(err, cb){
11051105
conststate=this._writableState;
11061106

11071107
// Invoke pending callbacks.
1108-
if((state[kState]&(kBuffered|kOnFinished|kDestroyed))!==kDestroyed){
1108+
if((state[kState]&(kBuffered|kOnFinished))!==0&&(state[kState]&kDestroyed)===0){
11091109
process.nextTick(errorBuffer,state);
11101110
}
11111111

0 commit comments

Comments
(0)