aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2014-11-25 16:58:37 +0100
committerBjörn-Egil Dahlberg <[email protected]>2015-03-12 17:16:06 +0100
commit6c94fede355561f0b4241005e5ffecdba210825d (patch)
tree71f660f197e60146dd148f9897a60ee72caa5dbf
parentf56956cfac208939bbfa2164c38cfe0c8907aa1b (diff)
downloadotp-6c94fede355561f0b4241005e5ffecdba210825d.tar.gz
otp-6c94fede355561f0b4241005e5ffecdba210825d.tar.bz2
otp-6c94fede355561f0b4241005e5ffecdba210825d.zip
Don't use modulus for power of 2
-rw-r--r--erts/emulator/beam/erl_hashmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_hashmap.c b/erts/emulator/beam/erl_hashmap.c
index b36f0c6150..11d2309fe3 100644
--- a/erts/emulator/beam/erl_hashmap.c
+++ b/erts/emulator/beam/erl_hashmap.c
@@ -49,9 +49,9 @@
#endif
#define hashmap_restore_hash(Heap,Lvl,Key) \
- ((Lvl) < 8) ? make_hash2(Key) >> (4*(Lvl)) : make_hash2(CONS(Heap, make_small(Lvl), (Key))) >> (4*((Lvl) % 8))
+ ((Lvl) < 8) ? make_hash2(Key) >> (4*(Lvl)) : make_hash2(CONS(Heap, make_small(Lvl), (Key))) >> (4*((Lvl) & 7))
#define hashmap_shift_hash(Heap,Hx,Lvl,Key) \
- ((++(Lvl)) % 8) ? (Hx) >> 4 : make_hash2(CONS(Heap, make_small(Lvl), Key))
+ ((++(Lvl)) & 7) ? (Hx) >> 4 : make_hash2(CONS(Heap, make_small(Lvl), Key))
#if 0
static char *format_binary(Uint64 x, char *b) {