mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-20 06:21:13 +01:00
refactor(core): avoid manually reimplemented sort_by_key (#7366)
This commit is contained in:
1 parent
da7deb4381
commit
4db992a66d
1 file changed
+2
-4
@@ -490,10 +490,8 @@ impl Instance {
|
||||
};
|
||||
|
||||
fn sort(adapters: &mut [hal::DynExposedAdapter], prefer_integrated_gpu: bool) {
|
||||
adapters.sort_by(|a, b| {
|
||||
get_order(a.info.device_type, prefer_integrated_gpu)
|
||||
.cmp(&get_order(b.info.device_type, prefer_integrated_gpu))
|
||||
});
|
||||
adapters
|
||||
.sort_by_key(|adapter| get_order(adapter.info.device_type, prefer_integrated_gpu));
|
||||
}
|
||||
|
||||
fn get_order(device_type: wgt::DeviceType, prefer_integrated_gpu: bool) -> u8 {
|
||||
|
||||
Reference in new issue
Block a user