stream: fix Writable.destroy performance regression
Ref: https://github.com/nodejs/node/pull/50409 PR-URL: https://github.com/nodejs/node/pull/50478 Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
parent
3daa0a6c04
commit
c4decd72f8
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user