]> gitweb.factorcode.org Git - factor.git/commitdiff
regexp.compiler: slightly faster with t/f check.
authorJohn Benediktsson <mrjbq7@gmail.com>
Mon, 19 May 2014 03:42:02 +0000 (20:42 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Mon, 19 May 2014 03:42:02 +0000 (20:42 -0700)
basis/regexp/compiler/compiler.factor

index a8b3c9168b1dec6e4381ae9fe1038d9ee2342532..645e3dd841b78af66b0788a913915ce0e68679eb 100644 (file)
@@ -118,15 +118,13 @@ C: <box> box
 
 : states>words ( dfa -- words dfa )
     dup transitions>> keys [ gensym ] H{ } map>assoc
-    [ transitions-at ]
-    [ values ]
-    bi swap ; 
+    [ transitions-at ] [ values ] bi swap ;
 
 : dfa>main-word ( dfa -- word )
     states>words [ states>code ] keep start-state>> ;
 
 : word-template ( quot -- quot' )
-    '[ drop [ f ] 2dip over array-capacity? _ [ 2drop ] if ] ;
+    '[ drop [ f ] 2dip over _ [ 2drop ] if ] ;
 
 PRIVATE>