diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-10-25 07:54:45 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-10-25 07:54:45 -0700 |
commit | 118dc224ef5f1481dddfb96a98b84d9a97bd91e6 (patch) | |
tree | aa4be218a7c94ee45928dac4885bf23d4df10e2e /hash.c | |
parent | ee5acb6757a4ed2ebda42cba25024d45d4d348a0 (diff) | |
download | txr-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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: |