X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_data_structures%2Fsrc%2Fstable_hasher.rs;h=b3958af7a4d50d16f736312dea232afabf4c423b;hb=e4b4d18f589b2d0cfcf244124ab43da34a3d8794;hp=354f9dd93cc4d4e491f6a15feffcdbf491a837dd;hpb=22714ed4e3954b3d60b3650bad743ec4b3d64d27;p=rust.git diff --git a/compiler/rustc_data_structures/src/stable_hasher.rs b/compiler/rustc_data_structures/src/stable_hasher.rs index 354f9dd93cc..b3958af7a4d 100644 --- a/compiler/rustc_data_structures/src/stable_hasher.rs +++ b/compiler/rustc_data_structures/src/stable_hasher.rs @@ -552,7 +552,8 @@ pub fn hash_stable_hashmap( SK: HashStable + Ord, F: Fn(&K, &HCX) -> SK, { - let mut entries: Vec<_> = map.iter().map(|(k, v)| (to_stable_hash_key(k, hcx), v)).collect(); + let mut entries: SmallVec<[_; 3]> = + map.iter().map(|(k, v)| (to_stable_hash_key(k, hcx), v)).collect(); entries.sort_unstable_by(|&(ref sk1, _), &(ref sk2, _)| sk1.cmp(sk2)); entries.hash_stable(hcx, hasher); }