diff options
author | Melody Horn <melody@boringcactus.com> | 2021-04-01 12:36:14 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-04-01 12:36:14 -0600 |
commit | a2066ced1fb3bf782514a439ad0981fcb1f0df51 (patch) | |
tree | 1f91d1745ed3cabe680e41993749f26fc8c03ae5 | |
parent | 5ea07dac9cbdda5333a77b0b90cec8cf5465131a (diff) | |
download | bird-machine-a2066ced1fb3bf782514a439ad0981fcb1f0df51.tar.gz bird-machine-a2066ced1fb3bf782514a439ad0981fcb1f0df51.zip |
don't put duplicates on the queue
-rw-r--r-- | bird-machine-macros/src/dfa.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bird-machine-macros/src/dfa.rs b/bird-machine-macros/src/dfa.rs index 0aec059..6f5e6f7 100644 --- a/bird-machine-macros/src/dfa.rs +++ b/bird-machine-macros/src/dfa.rs @@ -49,7 +49,7 @@ impl From<NFA> for LabeledDFA<BTreeSet<usize>> { } for states in next_table.values() { - if !transition_table.contains_key(states) { + if !transition_table.contains_key(states) && !queue.contains(states) { queue.push_back(states.clone()); } } |