MCPcopy Create free account
hub / github.com/argumentcomputer/ix / scc_to_vec

Function scc_to_vec

crates/compile/src/condense.rs:142–156  ·  view source on GitHub ↗
(map: &CondensedBlocks)

Source from the content-addressed store, hash-verified

140 }
141
142 fn scc_to_vec(map: &CondensedBlocks) -> Vec<Vec<Name>> {
143 let mut seen = FxIndexSet::default();
144 let mut sccs = Vec::new();
145 for (k, lo) in map.low_links.iter() {
146 let set = map.blocks.get(lo).unwrap();
147 if !seen.contains(k) {
148 let mut names: Vec<_> = set.iter().cloned().collect();
149 names.sort();
150 sccs.push(names);
151 seen.extend(set.iter().cloned());
152 }
153 }
154 sccs.sort();
155 sccs
156 }
157
158 #[test]
159 fn single_node() {

Callers

nothing calls this directly

Calls 5

pushMethod · 0.80
iterMethod · 0.45
getMethod · 0.45
containsMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected