]> gitweb.factorcode.org Git - factor.git/commitdiff
sequences: simplify (map-find).
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 8 Feb 2017 03:42:58 +0000 (19:42 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 8 Feb 2017 03:42:58 +0000 (19:42 -0800)
core/sequences/sequences.factor

index b559d3659483be15bb3b8e291bb2eec565bf52ad..7fbb53ed5fc954859b3a3ae7ccae0c6cc4dd2e60 100644 (file)
@@ -1011,8 +1011,7 @@ PRIVATE>
 <PRIVATE
 
 : (map-find) ( seq quot find-quot -- result elt )
-    [ [ f ] 2dip [ [ nip ] dip call dup ] curry ] dip call
-    [ [ drop f ] unless ] dip ; inline
+    [ [ f ] 2dip [ nip ] prepose [ dup ] compose ] dip call nip ; inline
 
 PRIVATE>