Skip to content

Commit 6012e3e

Browse files
ronagUlisesGascon
authored andcommitted
stream: fix Writable.destroy performance regression
Ref: #50409 PR-URL: #50478 Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent c1a196c commit 6012e3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/streams/writable.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ Writable.prototype.destroy = function(err, cb) {
11051105
const state = 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)