mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
perf(js/http): avoid v8 deopt in async iterator (#10160)
This commit is contained in:
parent
262ee78592
commit
83f6d4bf94
1 changed files with 2 additions and 2 deletions
|
@ -81,8 +81,8 @@
|
||||||
return {
|
return {
|
||||||
async next() {
|
async next() {
|
||||||
const reqEvt = await httpConn.nextRequest();
|
const reqEvt = await httpConn.nextRequest();
|
||||||
if (reqEvt === null) return { value: undefined, done: true };
|
// Change with caution, current form avoids a v8 deopt
|
||||||
return { value: reqEvt, done: false };
|
return { value: reqEvt, done: reqEvt === null };
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue