]> gitweb.factorcode.org Git - factor.git/commitdiff
assocs: 50% faster zip.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 26 Apr 2012 03:09:21 +0000 (20:09 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 26 Apr 2012 03:09:21 +0000 (20:09 -0700)
core/assocs/assocs.factor

index f2fee03997ce61d4947cac255a98fe3f2a83e34f..c48a3bc4358b8474dc9921b0f26b237db4c5630f 100644 (file)
@@ -182,7 +182,7 @@ M: assoc value-at* swap [ = nip ] curry assoc-find nip ;
     [ ?push ] change-at ;
 
 : zip ( keys values -- alist )
-    2array flip ; inline
+    [ 2array ] { } 2map-as ; inline
 
 : unzip ( assoc -- keys values )
     dup assoc-empty? [ drop { } { } ] [ >alist flip first2 ] if ;