karanlyons / murmurHash3.js

MurmurHash3, in JavaScript.
MIT License
195 stars 54 forks source link

switch(remainder) case 2 & 3 in 32-bit appears to not modify hash #10

Closed awsles closed 4 years ago

awsles commented 4 years ago

In the JavaScript function x86.hash32, the switch(remainder) statement at line 237 modifies k1 in each case. However, for case 3 and 2, h does not appear to be modified by k1 before exiting the function (in case 1, it is clearly modified).

What am I missing?

karanlyons commented 4 years ago

switch cases implicitly fall through, they’re basically just gotos.