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 <ruben@bridgewater.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information
陈刚 authored and MylesBorins committed Feb 21, 2018
1 parent 7910c00 commit 4aff6a7
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 4aff6a7

Please sign in to comment.