summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-10-25 07:54:45 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-10-25 07:54:45 -0700
commit118dc224ef5f1481dddfb96a98b84d9a97bd91e6 (patch)
treeaa4be218a7c94ee45928dac4885bf23d4df10e2e /hash.c
parentee5acb6757a4ed2ebda42cba25024d45d4d348a0 (diff)
downloadtxr-118dc224ef5f1481dddfb96a98b84d9a97bd91e6.tar.gz
txr-118dc224ef5f1481dddfb96a98b84d9a97bd91e6.tar.bz2
txr-118dc224ef5f1481dddfb96a98b84d9a97bd91e6.zip
hashing: partially revert 63feff9c.
Mixing the hash seed with the hashes for characters, fixnums and pointers by multiplication doesn't make sense. It doesn't perturb the hash sufficiently. * hash.c (equal_hash): Do not multiply the hash by the seed for CHR, NUM, SYM, PKG and ENV.
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hash.c b/hash.c
index f06fea61..27d62dba 100644
--- a/hash.c
+++ b/hash.c
@@ -217,17 +217,17 @@ ucnum equal_hash(val obj, int *count, ucnum seed)
case STR:
return hash_c_str(obj->st.str, seed, count);
case CHR:
- return c_chr(obj) * seed;
+ return c_chr(obj);
case NUM:
- return c_num(obj) * seed;
+ return c_num(obj);
case SYM:
case PKG:
case ENV:
switch (CHAR_BIT * sizeof (mem_t *)) {
case 32:
- return (coerce(ucnum, obj) >> 4) * seed;
+ return coerce(ucnum, obj) >> 4;
case 64: default:
- return (coerce(ucnum, obj) >> 5) * seed;
+ return coerce(ucnum, obj) >> 5;
}
break;
case FUN: