Skip to content

Commit 1a0987e

Browse files
committed
Switch to list appends in concatenate follow
1 parent e56ff56 commit 1a0987e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

interegular/fsm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,15 +350,15 @@ def follow(current, new_transition):
350350
next FSM if we reach the end of the current one
351351
TODO: improve all follow() implementations to allow for dead metastates?
352352
"""
353-
next_states = set()
353+
next_states = []
354354
for (i, substate) in current:
355355
fsm = fsms[i]
356356
current_vertex: TransitionKey = new_to_old[i][new_transition]
357357
if substate in fsm.map and current_vertex in fsm.map[substate]:
358-
next_states.update(connect_all(i, fsm.map[substate][current_vertex]))
358+
next_states.append(connect_all(i, fsm.map[substate][current_vertex]))
359359
if not next_states:
360360
raise OblivionError
361-
return frozenset(next_states)
361+
return frozenset(chain.from_iterable(next_states))
362362

363363
return crawl(alphabet, initial, final, follow)
364364

0 commit comments

Comments
 (0)