hashtables: make hash-combine use fixnum primitives.
parent
6210edf76e
commit
390dd23261
|
@ -188,7 +188,9 @@ M: hashtable assoc-like
|
|||
! magic number is 2^29/phi instead of 2^32/phi
|
||||
! due to max fixnum value on 32-bit machines
|
||||
: hash-combine ( hash1 hash2 -- newhash )
|
||||
[ 0x13c6ef37 + ] dip [ 6 shift ] [ -2 shift ] bi + + ; inline
|
||||
[ >fixnum ] bi@ [ 0x13c6ef37 fixnum+fast ] dip
|
||||
[ 6 fixnum-shift-fast ] [ -2 fixnum-shift-fast ] bi
|
||||
fixnum+fast fixnum+fast ; inline
|
||||
|
||||
: 2hashcode ( obj1 obj2 -- hash )
|
||||
[ hashcode ] bi@ hash-combine ; inline
|
||||
|
|
Loading…
Reference in New Issue