diff options
| author | Michael Woerister <michaelwoerister@posteo.net> | 2016-09-13 08:40:14 -0400 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo.net> | 2016-09-13 15:22:51 -0400 |
| commit | 94d75013bcf6fc8e79cd7c0c76c37e68c458db6f (patch) | |
| tree | 4cf189c8e856a08deecf06c5686ac353a816cbcb | |
| parent | 5c923f0159105bf9491a86cd5bd7eb20807387b6 (diff) | |
| download | rust-94d75013bcf6fc8e79cd7c0c76c37e68c458db6f.tar.gz rust-94d75013bcf6fc8e79cd7c0c76c37e68c458db6f.zip | |
Remove redundant sorting of projections in TypeIdHasher.
| -rw-r--r-- | src/librustc/ty/util.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/librustc/ty/util.rs b/src/librustc/ty/util.rs index 6b3ebaa895f..c6020838b53 100644 --- a/src/librustc/ty/util.rs +++ b/src/librustc/ty/util.rs @@ -458,15 +458,11 @@ impl<'a, 'gcx, 'tcx> TypeVisitor<'tcx> for TypeIdHasher<'a, 'gcx, 'tcx> { data.region_bound.visit_with(self); self.hash(data.builtin_bounds); - // Only projection bounds are left, sort and hash them. - let mut projection_bounds: Vec<_> = data.projection_bounds - .iter() - .map(|b| (b.item_name().as_str(), b)) - .collect(); - projection_bounds.sort_by_key(|&(ref name, _)| name.clone()); - for (name, bound) in projection_bounds { + // Only projection bounds are left, hash them. + self.hash(data.projection_bounds.len()); + for bound in &data.projection_bounds { self.def_id(bound.0.trait_ref.def_id); - self.hash(name); + self.hash(bound.0.item_name); bound.visit_with(self); } |
