diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-08-08 14:24:29 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-08-08 15:38:20 +1000 |
| commit | 3c99b3dbd01389be9c6f320f179bd3fdf68913f5 (patch) | |
| tree | 087c97220c57940bd93d26fc4962cccf2d10a3aa /compiler/rustc_trait_selection | |
| parent | 1c583c0b914eb46164f233f9ba2d0d351e64da1f (diff) | |
| download | rust-3c99b3dbd01389be9c6f320f179bd3fdf68913f5.tar.gz rust-3c99b3dbd01389be9c6f320f179bd3fdf68913f5.zip | |
Size the `deduped` set appropriately.
Avoids lots of resizing as the set fills up.
Diffstat (limited to 'compiler/rustc_trait_selection')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/project.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/project.rs b/compiler/rustc_trait_selection/src/traits/project.rs index 4b13abb8790..519b5f80d26 100644 --- a/compiler/rustc_trait_selection/src/traits/project.rs +++ b/compiler/rustc_trait_selection/src/traits/project.rs @@ -1229,7 +1229,7 @@ fn opt_normalize_projection_type<'a, 'b, 'tcx>( 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())); if use_cache { |
