Skip to content

Commit 3c99b3d

Browse files
committed
Size the deduped set appropriately.
Avoids lots of resizing as the set fills up.
1 parent 1c583c0 commit 3c99b3d

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_trait_selection/src/traits

1 file changed

+1
-1
lines changed

compiler/rustc_trait_selection/src/traits/project.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ fn opt_normalize_projection_type<'a, 'b, 'tcx>(
12291229
Normalized { value: projected_term, obligations: projected_obligations }
12301230
};
12311231

1232-
let mut deduped: SsoHashSet<_> = Default::default();
1232+
let mut deduped = SsoHashSet::with_capacity(projected_obligations.len());
12331233
result.obligations.retain(|obligation| deduped.insert(obligation.clone()));
12341234

12351235
if use_cache {

0 commit comments

Comments
 (0)