fixes u3_atom/c3_w mixup in +muk jet, refactors
seed_w = u3r_word(0, seed);
len_w = u3r_word(0, len);
- if (len_w > 0) { /* can't u3a_calloc 0 bytes */
- key_y = u3a_calloc(sizeof(c3_y), len);
- } else {
+
+ // can't u3a_calloc 0 bytes
+ //
+ if ( 0 == len_w ) {
key_y = 0;
}
- u3r_bytes(0, len, key_y, key);
+ else {
+ key_y = u3a_calloc(sizeof(c3_y), len_w);
+ }
+
+ u3r_bytes(0, len_w, key_y, key);
- MurmurHash3_x86_32(key_y, len, seed_w, &out_w);
+ // XX we could skip the copy and use _mur_words() instead
+ //
+ MurmurHash3_x86_32(key_y, len_w, seed_w, &out_w);
u3a_free(key_y);
return u3i_words(1, &out_w);
