// Often a transition (choice/event) can result into forwarding/backtracking to a number of states
boolean terminate = false;
for(Integer stateId : justVisitedStates) {
- // We only flip the value of terminate once ...
- if (!terminate && prevVisitedStates.contains(stateId) || completeFullCycle(stateId)) {
+ // We perform updates on backtrack sets for every
+ if (prevVisitedStates.contains(stateId) || completeFullCycle(stateId)) {
updateBacktrackSetsFromGraph(stateId);
terminate = true;
}