diff --git a/compiler/can/src/reference_matrix.rs b/compiler/can/src/reference_matrix.rs index 13ba3caea2..3b7a2a6f11 100644 --- a/compiler/can/src/reference_matrix.rs +++ b/compiler/can/src/reference_matrix.rs @@ -131,6 +131,16 @@ impl ReferenceMatrix { /// Get the strongly-connected components of the set of input nodes. pub fn strongly_connected_components(&self, nodes: &[u32]) -> Sccs { + let mut bitvec = BitVec::repeat(false, self.length); + + for value in nodes { + bitvec.set(*value as usize, true); + } + + self.strongly_connected_components_help(&bitvec) + } + + fn strongly_connected_components_help(&self, nodes: &BitSlice) -> Sccs { let mut params = Params::new(self.length, nodes); 'outer: loop { @@ -180,11 +190,11 @@ struct Params { } impl Params { - fn new(length: usize, group: &[u32]) -> Self { + fn new(length: usize, group: &BitSlice) -> Self { let mut preorders = vec![Preorder::Removed; length]; - for value in group { - preorders[*value as usize] = Preorder::Empty; + for index in group.iter_ones() { + preorders[index] = Preorder::Empty; } Self { diff --git a/compiler/load_internal/src/file.rs b/compiler/load_internal/src/file.rs index f97bf7d012..8e210557b8 100644 --- a/compiler/load_internal/src/file.rs +++ b/compiler/load_internal/src/file.rs @@ -1159,7 +1159,7 @@ pub fn load<'a>( ) -> Result, LoadingProblem<'a>> { // When compiling to wasm, we cannot spawn extra threads // so we have a single-threaded implementation - if threading == Threading::Single || cfg!(target_family = "wasm") { + if true || threading == Threading::Single || cfg!(target_family = "wasm") { load_single_threaded( arena, load_start,