]> gitweb.factorcode.org Git - factor.git/commitdiff
sorting.insertion: faster with unsafe words.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 14 Oct 2013 22:28:05 +0000 (15:28 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 14 Oct 2013 22:28:05 +0000 (15:28 -0700)
basis/sorting/insertion/insertion.factor

index 0615893f078e69d54831bf8a8413cd576a1f61b6..a1752b6742648b2900ff62518eeda3090845b14d 100644 (file)
@@ -1,11 +1,11 @@
-USING: locals sequences kernel math ;
+USING: kernel locals math sequences sequences.private ;
 IN: sorting.insertion
 
 <PRIVATE
 :: insert ( ... seq quot: ( ... elt -- ... elt' ) n -- ... )
     n zero? [
-        n n 1 - [ seq nth quot call ] bi@ >= [
-            n n 1 - seq exchange
+        n n 1 - [ seq nth-unsafe quot call ] bi@ >= [
+            n n 1 - seq exchange-unsafe
             seq quot n 1 - insert
         ] unless
     ] unless ; inline recursive