regexp.compiler: slightly faster with t/f check.

db4
John Benediktsson 2014-05-18 20:42:02 -07:00
parent 889eb9b2ef
commit 647b8ffb46
1 changed files with 2 additions and 4 deletions

View 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>