Skip to content

Commit 2b5ab2d

Browse files
authored
Micro-optimize emscripten_set_main_loop_timing. NFC (emscripten-core#26253)
1 parent e998496 commit 2b5ab2d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/lib/libeventloop.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,10 @@ LibraryJSEventLoop = {
339339
MainLoop.requestAnimationFrame(MainLoop.runner);
340340
};
341341
MainLoop.method = 'rAF';
342-
} else if (mode == {{{ cDefs.EM_TIMING_SETIMMEDIATE}}}) {
342+
} else {
343+
#if ASSERTIONS
344+
assert(mode == {{{ cDefs.EM_TIMING_SETIMMEDIATE}}});
345+
#endif
343346
if (!MainLoop.setImmediate) {
344347
if (globalThis.setImmediate) {
345348
MainLoop.setImmediate = setImmediate;

test/codesize/test_codesize_hello_dylink_all.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"a.out.js": 244700,
2+
"a.out.js": 244691,
33
"a.out.nodebug.wasm": 577696,
4-
"total": 822396,
4+
"total": 822387,
55
"sent": [
66
"IMG_Init",
77
"IMG_Load",

0 commit comments

Comments
 (0)