]> gitweb.factorcode.org Git - factor.git/commitdiff
sorting.extras: faster map-sort.
authorJohn Benediktsson <mrjbq7@gmail.com>
Fri, 5 Dec 2014 18:50:32 +0000 (10:50 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 5 Dec 2014 18:50:32 +0000 (10:50 -0800)
extra/sorting/extras/extras.factor

index 39f45757e8eb8ca6f12b8b2e3b0ff008a701545d..949c54885bd9b3ad8c9b1139847a08444e351c37 100644 (file)
@@ -8,7 +8,7 @@ IN: sorting.extras
     sort [ second-unsafe ] map! ; inline
 
 : map-sort ( ... seq quot: ( ... elt -- ... key ) -- ... sortedseq )
-    [ map ] curry keep zip
+    [ keep ] curry { } map>assoc
     [ { array } declare first-unsafe ] sort-with
     [ { array } declare second-unsafe ] map ; inline