Remove unnecessary sort in explore search fn (#13690)

Noticed when playing with the `stable_sort_primitive` lint that the
elements from `enumerate` are already sorted.
This commit is contained in:
Stefan Holderbach 2024-08-25 20:13:05 +02:00 committed by GitHub
parent 3f332bef35
commit e3efc8da9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -860,10 +860,8 @@ fn search_pattern(data: impl Iterator<Item = String>, pat: &str, rev: bool) -> V
}
}
if !rev {
matches.sort();
} else {
matches.sort_by(|a, b| b.cmp(a));
if rev {
matches.reverse();
}
matches