Skip to content

Commit

Permalink
sort_by_cached_key -> sort_by
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkuu committed Dec 4, 2018
1 parent 65aa0a6 commit bc7c3dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc_mir/monomorphize/partitioning.rs
Expand Up @@ -585,7 +585,7 @@ fn merge_codegen_units<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>,
// smallest into each other) we're sure to start off with a deterministic
// order (sorted by name). This'll mean that if two cgus have the same size
// the stable sort below will keep everything nice and deterministic.
codegen_units.sort_by_key(|cgu| cgu.name().clone());
codegen_units.sort_by_key(|cgu| *cgu.name());

// Merge the two smallest codegen units until the target size is reached.
while codegen_units.len() > target_cgu_count {
Expand Down Expand Up @@ -985,7 +985,7 @@ fn collect_and_partition_mono_items<'a, 'tcx>(
output.push_str(" @@");
let mut empty = Vec::new();
let cgus = item_to_cgus.get_mut(i).unwrap_or(&mut empty);
cgus.as_mut_slice().sort_by_cached_key(|&(ref name, _)| name.clone());
cgus.sort_by_key(|(name, _)| *name);
cgus.dedup();
for &(ref cgu_name, (linkage, _)) in cgus.iter() {
output.push_str(" ");
Expand Down

0 comments on commit bc7c3dc

Please sign in to comment.