Skip to content

Commit fe83419

Browse files
committed
stream: fix Writable.destroy performance regression
1 parent 4ddb263 commit fe83419

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
@@ -1091,7 +1091,7 @@ Writable.prototype.destroy = function(err, cb) {
10911091
const state = this._writableState;
10921092

10931093
// Invoke pending callbacks.
1094-
if ((state[kState] & (kBuffered | kOnFinished | kDestroyed)) !== kDestroyed) {
1094+
if ((state[kState] & (kBuffered | kOnFinished)) !== 0 && (state[kState] & kDestroyed) === 0) {
10951095
process.nextTick(errorBuffer, state);
10961096
}
10971097

0 commit comments

Comments
 (0)