From 3db1e292a39e34c6d10cb972a7f88b98f80c0a5e Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Fri, 8 Mar 2013 16:50:59 -0800 Subject: [PATCH] regexp.dfa: more use of hash-sets. --- basis/regexp/dfa/dfa.factor | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/basis/regexp/dfa/dfa.factor b/basis/regexp/dfa/dfa.factor index 8ded517c2a..e25c0f13b4 100644 --- a/basis/regexp/dfa/dfa.factor +++ b/basis/regexp/dfa/dfa.factor @@ -43,9 +43,7 @@ IN: regexp.dfa [ tagged-epsilon? not ] filter ; : add-todo-state ( state visited-states new-states -- ) - 2over key? [ 3drop ] [ - [ conjoin ] [ push ] bi-curry* bi - ] if ; + 2over ?adjoin [ nip push ] [ 3drop ] if ; : add-todo-states ( state/condition visited-states new-states -- ) [ condition-states ] 2dip @@ -82,6 +80,6 @@ IN: regexp.dfa : construct-dfa ( nfa -- dfa ) dup initialize-dfa dup start-state>> condition-states >vector - H{ } clone + HS{ } clone new-transitions [ set-final-states ] keep ;