Commit 3e459c8f authored by Roman Yurchak's avatar Roman Yurchak Committed by GitHub

Merge pull request #169 from mdboom/use-bitwise-and

MAINT: Use bitwise and rather than mod, for performance
parents 2e23079a 609e1def
......@@ -7,11 +7,11 @@ EM_JS(void, hiwire_setup, (), {
{
var objects = hiwire.objects;
while (hiwire.counter in objects) {
hiwire.counter = (hiwire.counter + 1) % 0x8fffffff;
hiwire.counter = (hiwire.counter + 1) & 0x7fffffff;
}
var idval = hiwire.counter;
objects[idval] = jsval;
hiwire.counter = (hiwire.counter + 1) % 0x8fffffff;
hiwire.counter = (hiwire.counter + 1) & 0x7fffffff;
return idval;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment