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

Function alive_graph_reaches

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

Source from the content-addressed store, hash-verified

629}
630
631fn 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}

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