]> gitweb.factorcode.org Git - factor.git/blobdiff - core/strings/strings.factor
Revert "sequences: change to use tuple-hashcode algorithm, make string-hashcode work...
[factor.git] / core / strings / strings.factor
index e2f9f279e8a88cf309931c860a376c6a18b9f596..e57edf282aea2a6a585f5074e1ed2e03c8683961 100644 (file)
@@ -13,14 +13,8 @@ IN: strings
 : reset-string-hashcode ( str -- )
     f swap set-string-hashcode ; inline
 
-: string-hashcode-step ( oldhash newpart -- newhash )
-    >fixnum swap [
-        [ -2 fixnum-shift-fast ] [ 5 fixnum-shift-fast ] bi
-        fixnum+fast fixnum+fast
-    ] keep fixnum-bitxor ; inline
-
 : rehash-string ( str -- )
-    [ 0 [ string-hashcode-step ] reduce ] keep set-string-hashcode ; inline
+    1 over sequence-hashcode swap set-string-hashcode ; inline
 
 : (aux) ( n string -- byte-array m )
     aux>> { byte-array } declare swap 1 fixnum-shift-fast ; inline