(graph: &AliveGraph, from: VertexId, target: VertexId)
| 616 | } |
| 617 | |
| 618 | fn alive_graph_reaches(graph: &AliveGraph, from: VertexId, target: VertexId) -> bool { |
| 619 | if from == target { |
| 620 | return true; |
| 621 | } |
| 622 | |
| 623 | let mut stack = vec![from]; |
| 624 | let mut seen = std::collections::HashSet::new(); |
| 625 | |
| 626 | while let Some(current) = stack.pop() { |
| 627 | if !seen.insert(current) { |
| 628 | continue; |
| 629 | } |
| 630 | |
| 631 | for (_, child) in graph.children(current) { |
| 632 | if child.is_dummy() { |
| 633 | continue; |
| 634 | } |
| 635 | if *child == target { |
| 636 | return true; |
| 637 | } |
| 638 | stack.push(*child); |
| 639 | } |
| 640 | } |
| 641 | |
| 642 | false |
| 643 | } |
no test coverage detected