mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
move correct_mutual_recursive_type_alias
over
This commit is contained in:
parent
0569d23385
commit
62a80db379
2 changed files with 29 additions and 23 deletions
|
@ -181,6 +181,25 @@ impl ReferenceMatrix {
|
|||
break result;
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the strongly-connected components of the set of input nodes.
|
||||
pub fn strongly_connected_components_prim(&self, nodes: &[u32]) -> Sccs {
|
||||
let mut params = Params::new(self.length, nodes);
|
||||
|
||||
'outer: loop {
|
||||
for (node, value) in params.preorders.iter().enumerate() {
|
||||
if let Preorder::Removed = value {
|
||||
continue;
|
||||
}
|
||||
|
||||
recurse_onto(self.length, &self.bitvec, node, &mut params);
|
||||
|
||||
continue 'outer;
|
||||
}
|
||||
|
||||
break params.scc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) enum TopologicalSort {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue