refactor(app-list): no need to check name when sorting

This commit is contained in:
Ashley Wulber 2024-03-11 21:07:23 -04:00 committed by Ashley Wulber
parent ed049b1269
commit b7b4a7be34

View file

@ -78,12 +78,12 @@ pub fn load_applications_for_app_ids_sorted<'a, 'b>(
ret.sort_by(|a, b| { ret.sort_by(|a, b| {
app_ids app_ids
.clone() .clone()
.position(|id| id == a.id || a.name.to_lowercase() == id.to_lowercase()) .position(|id| id == a.id)
.unwrap_or(usize::MAX) .unwrap_or(usize::MAX)
.cmp( .cmp(
&app_ids &app_ids
.clone() .clone()
.position(|id| id == b.id || b.name.to_lowercase() == id.to_lowercase()) .position(|id| id == b.id)
.unwrap_or(usize::MAX), .unwrap_or(usize::MAX),
) )
}); });