MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / alive_graph_reaches

Function alive_graph_reaches

atomic-core/src/output/alive/retrieve/mod.rs:618–643  ·  view source on GitHub ↗
(graph: &AliveGraph, from: VertexId, target: VertexId)

Source from the content-addressed store, hash-verified

616}
617
618fn 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}

Callers 1

walk_through_deadFunction · 0.85

Calls 4

childrenMethod · 0.80
is_dummyMethod · 0.80
insertMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected