]> gitweb.factorcode.org Git - factor.git/commitdiff
hashtables: make hash-combine use fixnum primitives.
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 9 Jun 2015 23:30:04 +0000 (16:30 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 9 Jun 2015 23:30:04 +0000 (16:30 -0700)
core/hashtables/hashtables.factor

index 9da1d96ecb602e5d9d1e223d4210916bbf51a170..9ed45712886f647cd7f4a842cae189ae811a754e 100644 (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