1
0
Fork 0
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:
Aaron O'Mullan 2021-04-14 13:56:14 +02:00 committed by GitHub
parent 262ee78592
commit 83f6d4bf94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 };
}, },
}; };
} }