Skip to content

Commit

Permalink
Use .shift() instead
Browse files Browse the repository at this point in the history
  • Loading branch information
gingerBill committed Sep 20, 2024
1 parent 0288420 commit 2c5be4e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions vendor/wasm/js/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -1844,13 +1844,12 @@ async function runWasm(wasmPath, consoleElement, extraForeignImports, wasmMemory
const dt = (currTimeStamp - prevTimeStamp)*0.001;
prevTimeStamp = currTimeStamp;

for (let i = 0; i < eventQueue.length; i++) {
let e = eventQueue[i];
while (eventQueue.length > 0) {
let e = eventQueue.shift()
event_temp.data = e.event_data;
exports.odin_dom_do_event_callback(e.data, e.callback, odin_ctx);
}
event_temp.data = null;
eventQueue.length = 0;

if (!exports.step(currTimeStamp*0.001, odin_ctx)) {
exports._end();
Expand Down

0 comments on commit 2c5be4e

Please sign in to comment.