Skip to content

Commit

Permalink
stream: fix Writable.destroy performance regression
Browse files Browse the repository at this point in the history
Ref: #50409
PR-URL: #50478
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
  • Loading branch information
ronag authored and targos committed Nov 14, 2023
1 parent eac9cc5 commit 360f5d9
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 360f5d9

Please sign in to comment.