@@ -393,38 +393,23 @@ where
393393 // `InCycleWith` upwards.
394394 // This loop performs the downward link encoding mentioned above. Details below!
395395 let node_state = {
396- let mut annotation = ( self . to_annotation ) ( node) ;
397-
398396 loop {
399397 debug ! ( "find_state(r = {node:?} in state {:?})" , self . node_states[ node] ) ;
400398 match self . node_states [ node] {
401- NodeState :: NotVisited => break NodeState :: NotVisited ,
402- NodeState :: BeingVisited { depth, annotation : previous_annotation } => {
403- break NodeState :: BeingVisited {
404- depth,
405- annotation : previous_annotation. merge_scc ( annotation) ,
406- } ;
407- }
399+ s @ ( NodeState :: NotVisited | NodeState :: BeingVisited { ..} | NodeState :: InCycle { .. } ) => break s,
408400 NodeState :: InCycleWith { parent } => {
409401 // We test this, to be extremely sure that we never
410402 // ever break our termination condition for the
411403 // reverse iteration loop.
412404 assert ! ( node != parent, "Node can not be in cycle with itself" ) ;
413405
414- annotation = annotation. merge_scc ( ( self . to_annotation ) ( node) ) ;
415-
416406 // Store the previous node as an inverted list link
417407 self . node_states [ node] = NodeState :: InCycleWith { parent : previous_node } ;
418408 // Update to parent node.
419409 previous_node = node;
420410 node = parent;
421411 }
422- NodeState :: InCycle { scc_index, annotation : previous_annotation } => {
423- break NodeState :: InCycle {
424- scc_index,
425- annotation : previous_annotation. merge_scc ( annotation) ,
426- } ;
427- }
412+
428413 }
429414 }
430415 } ;
0 commit comments