cs: fix hash-code mixing
Hashing for structures and hash tables used a very poor mixing function.
This commit is contained in:
parent
ffdfd1824d
commit
bdb0256220
|
@ -179,7 +179,8 @@
|
||||||
[else (values (+/fx hc (eq-hash-code x)) burn)])))
|
[else (values (+/fx hc (eq-hash-code x)) burn)])))
|
||||||
|
|
||||||
(define (hash-code-combine hc v)
|
(define (hash-code-combine hc v)
|
||||||
(bitwise-and (+ (bitwise-arithmetic-shift-left hc 2)
|
(bitwise-and (+ (bitwise-arithmetic-shift-left hc 10)
|
||||||
|
(bitwise-arithmetic-shift-right hc 6)
|
||||||
v)
|
v)
|
||||||
(greatest-fixnum)))
|
(greatest-fixnum)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user