summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2017-07-18 03:53:50 -0700
committerOri Bernstein <ori@markovcorp.com>2017-07-18 10:49:14 -0700
commitd66406270f0743f0713c35cdcc8f371b58a50004 (patch)
tree7b3cf263b994ade7a77378c6bb4a8ac995896262 /util
parentaa40abd25de6fc94621a41b360b5808b3aa57b55 (diff)
downloadmc-d66406270f0743f0713c35cdcc8f371b58a50004.tar.gz
Fix murmurhash2 when string length is a multiple of a 4
The first h *= m after the loop should only happen for len % 4 != 0.
Diffstat (limited to 'util')
-rw-r--r--util/htab.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/util/htab.c b/util/htab.c
index 7ba6291..eafb663 100644
--- a/util/htab.c
+++ b/util/htab.c
@@ -322,10 +322,8 @@ murmurhash2 (void *ptr, size_t len)
case 3: h ^= p[2] << 16;
case 2: h ^= p[1] << 8;
case 1: h ^= p[0] << 0;
- default:
- break;
- };
- h *= m;
+ h *= m;
+ }
h ^= h >> 13;
h *= m;