mirror of
https://github.com/nushell/nushell.git
synced 2024-11-07 09:04:18 +01:00
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:
parent
3f332bef35
commit
e3efc8da9f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user