summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2012-03-24 19:57:52 +0100
committerYorhel <git@yorhel.nl>2012-03-24 19:57:52 +0100
commitdb8ce7e1914259911d44c9ac22dc9bd84d5a96a1 (patch)
treed404e2d6f6722612b58d1c212b8c134af76c51f7
parentba6257b91d3d75d836ce0a59d2a0a3afc3773ec2 (diff)
Fix over-allocation bug in hash table
Performance-wise, this over-allocation may not be too bad, it avoids some collisions. :-) (Talking about collisions, the hash function provided by khash.h performs quite poorly on the many-numbers test in tuple.c, I hope it does better for other kinds of data :-/)
-rw-r--r--tanja.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tanja.c b/tanja.c
index b7497dc..10663fd 100644
--- a/tanja.c
+++ b/tanja.c
@@ -376,7 +376,7 @@ static inline void tn_map_grow(tn_el *m, int new) {
if(!s)
s = 32;
while(s < ((m->count+new)*4)/3)
- s <<= 2;
+ s <<= 1;
assert(s < UINT16_MAX); // Might want to handle this
if(s == m->size)
return;