Size the deduped set appropriately.
Avoids lots of resizing as the set fills up.
This commit is contained in:
@@ -1229,7 +1229,7 @@ fn opt_normalize_projection_type<'a, 'b, 'tcx>(
|
|||||||
Normalized { value: projected_term, obligations: projected_obligations }
|
Normalized { value: projected_term, obligations: projected_obligations }
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut deduped: SsoHashSet<_> = Default::default();
|
let mut deduped = SsoHashSet::with_capacity(projected_obligations.len());
|
||||||
result.obligations.retain(|obligation| deduped.insert(obligation.clone()));
|
result.obligations.retain(|obligation| deduped.insert(obligation.clone()));
|
||||||
|
|
||||||
if use_cache {
|
if use_cache {
|
||||||
|
|||||||
Reference in New Issue
Block a user