Skip to content

Commit

Permalink
perf(js/http): avoid v8 deopt in async iterator (denoland#10160)
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronO authored Apr 14, 2021
1 parent 262ee78 commit 83f6d4b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/js/40_http.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
return {
async next() {
const reqEvt = await httpConn.nextRequest();
if (reqEvt === null) return { value: undefined, done: true };
return { value: reqEvt, done: false };
// Change with caution, current form avoids a v8 deopt
return { value: reqEvt, done: reqEvt === null };
},
};
}
Expand Down

0 comments on commit 83f6d4b

Please sign in to comment.