@@ -442,13 +442,6 @@ function onwriteError(stream, state, sync, er, cb) { |
|
|
442 |
442 |
} |
443 |
443 |
} |
444 |
444 |
|
445 |
|
-function onwriteStateUpdate(state) { |
446 |
|
-state.writing = false; |
447 |
|
-state.writecb = null; |
448 |
|
-state.length -= state.writelen; |
449 |
|
-state.writelen = 0; |
450 |
|
-} |
451 |
|
- |
452 |
445 |
function onwrite(stream, er) { |
453 |
446 |
const state = stream._writableState; |
454 |
447 |
const sync = state.sync; |
@@ -457,7 +450,10 @@ function onwrite(stream, er) { |
|
|
457 |
450 |
if (typeof cb !== 'function') |
458 |
451 |
throw new ERR_MULTIPLE_CALLBACK(); |
459 |
452 |
|
460 |
|
-onwriteStateUpdate(state); |
|
453 |
+state.writing = false; |
|
454 |
+state.writecb = null; |
|
455 |
+state.length -= state.writelen; |
|
456 |
+state.writelen = 0; |
461 |
457 |
|
462 |
458 |
if (er) |
463 |
459 |
onwriteError(stream, state, sync, er, cb); |