perf: use unstable sorting when async

Unstable sorting should be slightly faster than stable sorting, and if
the vector was built asynchronously then preserving the initial order
doesn't matter too much.

Continue to use stable sorting where the vector is not built
asynchronously, or if the vector is partially sorted (e.g. when new
elements are pushed to a sorted vector).
This commit is contained in:
Cheong Lau 2025-10-07 21:50:08 +10:00 committed by Michael Murphy
parent dd0158d8f0
commit 38c037c977
5 changed files with 6 additions and 6 deletions

View file

@ -808,6 +808,6 @@ async fn build_device_list(mut devices: Vec<BluerDevice>, adapter: &Adapter) ->
devices.push(device);
}
devices.sort();
devices.sort_unstable();
devices
}