nitcc: to_minimal_dfa is a little faster
authorJean Privat <jean@pryen.org>
Fri, 27 Oct 2017 13:15:54 +0000 (09:15 -0400)
committerJean Privat <jean@pryen.org>
Fri, 27 Oct 2017 13:15:54 +0000 (09:15 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

contrib/nitcc/src/autom.nit

index 2a97bd3..e0be1d4 100644 (file)
@@ -386,10 +386,9 @@ class Automaton
 
                # split accept states.
                # An accept state is distinct with a non accept state.
-               for s1 in states do
+               for s1 in accept do
                        for s2 in states do
                                if distincts[s1].has(s2) then continue
-                               if not accept.has(s1) then continue
                                if not accept.has(s2) then
                                        distincts[s1].add(s2)
                                        distincts[s2].add(s1)