Avoid Unstable Sort (#12455)

* dont use unstable sort

* remove comment

* add clippy rule
This commit is contained in:
Shawn Tabrizi authored and GitHub committed 2022-10-11 18:41:43 +00:00
1 parent fbdfa84cd7
commit 023aa03fea
9 files changed
+14 -17

No files matched your search

+2 -2
View File
@@ -181,7 +181,7 @@ impl Analysis {
})
.collect();
values.sort_unstable();
values.sort();
let mid = values.len() / 2;
Some(Self {
@@ -311,7 +311,7 @@ impl Analysis {
}
for (_, rs) in results.iter_mut() {
rs.sort_unstable();
rs.sort();
let ql = rs.len() / 4;
*rs = rs[ql..rs.len() - ql].to_vec();
}