Skip to content

Commit

Permalink
stream: delete redundant code
Browse files Browse the repository at this point in the history
`state.corkedRequestsFree` of a writable stream is always not null.

PR-URL: #18145
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
  • Loading branch information
陈刚 authored and MylesBorins committed Feb 21, 2018
1 parent 560f657 commit 450f5f4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/_stream_writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -657,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;
}

Object.defineProperty(Writable.prototype, 'destroyed', {
Expand Down

0 comments on commit 450f5f4

Please sign in to comment.