(graph: &AliveGraph, from: VertexId, target: VertexId)
| 629 | } |
| 630 | |
| 631 | fn alive_graph_reaches(graph: &AliveGraph, from: VertexId, target: VertexId) -> bool { |
| 632 | if from == target { |
| 633 | return true; |
| 634 | } |
| 635 | |
| 636 | let mut stack = vec![from]; |
| 637 | let mut seen = std::collections::HashSet::new(); |
| 638 | |
| 639 | while let Some(current) = stack.pop() { |
| 640 | if !seen.insert(current) { |
| 641 | continue; |
| 642 | } |
| 643 | |
| 644 | for (_, child) in graph.children(current) { |
| 645 | if child.is_dummy() { |
| 646 | continue; |
| 647 | } |
| 648 | if *child == target { |
| 649 | return true; |
| 650 | } |
| 651 | stack.push(*child); |
| 652 | } |
| 653 | } |
| 654 | |
| 655 | false |
| 656 | } |
no test coverage detected