more vecs, less sets

This commit is contained in:
Folkert 2022-03-21 23:20:57 +01:00
parent 14b53c0ccf
commit 725eb217d8
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 30 additions and 18 deletions

View file

@ -1113,10 +1113,10 @@ fn canonicalize_when_branch<'a>(
)
}
pub fn local_successors<'a>(
pub fn local_successors_with_duplicates<'a>(
references: &'a References,
closures: &'a MutMap<Symbol, References>,
) -> ImSet<Symbol> {
) -> Vec<Symbol> {
let mut answer: Vec<_> = references.value_lookups.iter().copied().collect();
let mut stack: Vec<_> = references.calls.iter().copied().collect();
@ -1135,7 +1135,10 @@ pub fn local_successors<'a>(
}
}
answer.into_iter().collect()
answer.sort();
answer.dedup();
answer
}
enum CanonicalizeRecordProblem {