Skip to content

Commit

Permalink
stream: fix Writable.destroy performance regression
Browse files Browse the repository at this point in the history
Ref: nodejs#50409
PR-URL: nodejs#50478
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
  • Loading branch information
ronag authored and anonrig committed Nov 9, 2023
1 parent 5543ccd commit 5c8de42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/internal/streams/writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,7 @@ Writable.prototype.destroy = function(err, cb) {
const state = this._writableState;

// Invoke pending callbacks.
if ((state[kState] & (kBuffered | kOnFinished | kDestroyed)) !== kDestroyed) {
if ((state[kState] & (kBuffered | kOnFinished)) !== 0 && (state[kState] & kDestroyed) === 0) {
process.nextTick(errorBuffer, state);
}

Expand Down

0 comments on commit 5c8de42

Please sign in to comment.