aboutsummaryrefslogtreecommitdiff
path: root/bird-machine-macros
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-04-01 12:36:14 -0600
committerMelody Horn <melody@boringcactus.com>2021-04-01 12:36:14 -0600
commita2066ced1fb3bf782514a439ad0981fcb1f0df51 (patch)
tree1f91d1745ed3cabe680e41993749f26fc8c03ae5 /bird-machine-macros
parent5ea07dac9cbdda5333a77b0b90cec8cf5465131a (diff)
downloadbird-machine-a2066ced1fb3bf782514a439ad0981fcb1f0df51.tar.gz
bird-machine-a2066ced1fb3bf782514a439ad0981fcb1f0df51.zip
don't put duplicates on the queue
Diffstat (limited to 'bird-machine-macros')
-rw-r--r--bird-machine-macros/src/dfa.rs2
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());
}
}