Skip to content

Commit

Permalink
review#2
Browse files Browse the repository at this point in the history
  • Loading branch information
marcin-usielski committed Oct 16, 2024
1 parent 88b5a20 commit ad93857
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions moler/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,17 +587,17 @@ def remove_state_from_sm(source_sm: dict, source_transitions: dict, state_to_rem
new_sm = copy.deepcopy(source_sm)
new_transitions = copy.deepcopy(source_transitions)

from_states = []
states_from_state_to_remove = []
for from_state in source_sm.keys():
for to_state in source_sm[from_state].keys():
if to_state == state_to_remove:
from_states.append(from_state)
states_from_state_to_remove.append(from_state)

for to_state in source_sm[state_to_remove].keys():
if to_state == state_to_remove:
continue
for new_from in from_states:
if new_from != to_state and new_from != state_to_remove:
for new_from in states_from_state_to_remove:
if new_from != to_state:
break
if new_from not in new_sm:
new_sm[new_from] = {}
Expand Down

0 comments on commit ad93857

Please sign in to comment.