mirror of
https://github.com/veeso/termscp.git
synced 2026-04-02 00:02:17 -07:00
perf: use sort_by_cached_key to avoid repeated lowercase allocations in file sorting
This commit is contained in:
@@ -245,7 +245,8 @@ impl FileExplorer {
|
||||
|
||||
/// Sort explorer files by their name. All names are converted to lowercase
|
||||
fn sort_files_by_name(&mut self) {
|
||||
self.files.sort_by_key(|x: &File| x.name().to_lowercase());
|
||||
self.files
|
||||
.sort_by_cached_key(|x: &File| x.name().to_lowercase());
|
||||
}
|
||||
|
||||
/// Sort files by mtime; the newest comes first
|
||||
|
||||
Reference in New Issue
Block a user