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 rvagg committed Aug 16, 2018
1 parent af27768 commit c92d66a
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 @@ -638,11 +638,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 c92d66a

Please sign in to comment.