aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-08-31 16:16:00 +0200
committerThomas White <taw@physics.org>2015-08-31 16:17:01 +0200
commit47e429bb918cc1aa9c918410b57d2b1f4ff9231b (patch)
treebba020a72099571ee266cb67baa4d8839ef5bfea
parentea0c9be77763ca695d646d4f4239c69eb68974fc (diff)
partialator: Improve hash function (again)
-rw-r--r--src/partialator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/partialator.c b/src/partialator.c
index a3fc712e..59d78f11 100644
--- a/src/partialator.c
+++ b/src/partialator.c
@@ -84,7 +84,7 @@ static int csplit_hash(const char *id)
int h = 0;
for ( i=0; i<len; i++ ) {
- h = (h*i +id[i]) % CSPLIT_HASH_MAX;
+ h = (h*31 + id[i]) % CSPLIT_HASH_MAX;
}
assert(h < CSPLIT_HASH_MAX);