-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stream: delete redundant code #18145
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -307,7 +307,6 @@ Writable.prototype.uncork = function() { | |
|
||
if (!state.writing && | ||
!state.corked && | ||
!state.finished && | ||
!state.bufferProcessing && | ||
state.bufferedRequest) | ||
clearBuffer(this, state); | ||
|
@@ -579,7 +578,7 @@ Writable.prototype.end = function(chunk, encoding, cb) { | |
} | ||
|
||
// ignore unnecessary end() calls. | ||
if (!state.ending && !state.finished) | ||
if (!state.ending) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is actually a behavior change. Can you add a unit test? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
And,
|
||
endWritable(this, state, cb); | ||
}; | ||
|
||
|
@@ -658,11 +657,9 @@ function onCorkedFinish(corkReq, state, err) { | |
cb(err); | ||
entry = entry.next; | ||
} | ||
if (state.corkedRequestsFree) { | ||
state.corkedRequestsFree.next = corkReq; | ||
} else { | ||
state.corkedRequestsFree = corkReq; | ||
} | ||
|
||
// reuse the free corkReq. | ||
state.corkedRequestsFree.next = corkReq; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately, this can end up being There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
|
||
Object.defineProperty(Writable.prototype, 'destroyed', { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this unused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
state.finished
should equalfalse
ifstate.bufferedRequest
isn'tnull
.