hashtables: make hash-combine use fixnum primitives.

db4
John Benediktsson 2015-06-09 16:30:04 -07:00
parent 6210edf76e
commit 390dd23261
1 changed files with 3 additions and 1 deletions

View File

@ -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