-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use sort_by_cached_key where appropriate #49525
Changes from all commits
eacfb33
d3fe534
5cd0504
57eedba
1aa6152
2cc52f0
e7aa139
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -799,7 +799,7 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> { | |
.collect(); | ||
|
||
// sort them by the name so we have a stable result | ||
names.sort_by_key(|n| n.as_str()); | ||
names.sort_by_cached_key(|n| n.as_str()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
||
names | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1435,9 +1435,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> { | |||||||||||
// involved (impls rarely have more than a few bounds) means that it | ||||||||||||
// shouldn't matter in practice. | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also probably not this PR, but this comment makes me wonder if it would be worth adding Lines 1402 to 1406 in 1c5283b
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's another good point: I'll add that extra check in! ( |
||||||||||||
fn unstable_debug_sort<T: Debug>(&self, vec: &mut Vec<T>) { | ||||||||||||
vec.sort_unstable_by(|first, second| { | ||||||||||||
format!("{:?}", first).cmp(&format!("{:?}", second)) | ||||||||||||
}); | ||||||||||||
vec.sort_by_cached_key(|x| format!("{:?}", x)) | ||||||||||||
} | ||||||||||||
|
||||||||||||
fn is_fn_ty(&self, tcx: &TyCtxt, ty: &Type) -> bool { | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh cute!