Skip to content

Fix bug with clearNestedAutomaton function#38

Open
AlexShmak wants to merge 1 commit intospbu-se:developfrom
AlexShmak:fix
Open

Fix bug with clearNestedAutomaton function#38
AlexShmak wants to merge 1 commit intospbu-se:developfrom
AlexShmak:fix

Conversation

@AlexShmak
Copy link
Collaborator

No description provided.

}

private fun clearExecutionStatesInternal(visited: MutableSet<Automaton>) {
protected fun clearExecutionStatesInternal(visited: MutableSet<Automaton>) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я думаю, будет менее хрупко и более понятно, если оставить одну публичную функцию fun clearExecutionStates(visited: MutableSet<Automaton>) и убрать clearExecutionStatesInternal() и clearExecutionStatesFromOutside(), а во всех местах, где очищение вызывается снаружи, просто передать visitedStates=emptySet()

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Чтобы понизить вероятность будущих ошибок, связанных с рекурсией, советую оставить именно fun clearExecutionStates(visited: MutableSet<Automaton>), а не fun clearExecutionStates(visited: MutableSet<Automaton> = mutableSetOf())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants