mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
Use with_capacity
This commit is contained in:
parent
87a1b3b42d
commit
5b8d24d823
2 changed files with 5 additions and 1 deletions
|
@ -1703,7 +1703,7 @@ fn find_specialization_lambda_sets(
|
|||
// unspecialized lambda sets that don't belong to our specialization, and should be resolved
|
||||
// later.
|
||||
let mut leftover_uls = UlsOfVar::default();
|
||||
let mut specialization_lambda_sets: VecMap<u8, Variable> = VecMap::default();
|
||||
let mut specialization_lambda_sets: VecMap<u8, Variable> = VecMap::with_capacity(uls.len());
|
||||
|
||||
for (spec_var, lambda_sets) in uls.drain() {
|
||||
if !matches!(subs.get_content_without_compacting(spec_var), Content::Alias(name, _, _, AliasKind::Opaque) if *name == opaque)
|
||||
|
|
|
@ -345,6 +345,10 @@ impl UlsOfVar {
|
|||
.map(|(v, set): (Variable, VecSet<Variable>)| (v, set.into_iter()))
|
||||
}
|
||||
|
||||
pub fn len(&self) -> usize {
|
||||
self.0.len()
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.0.is_empty()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue