aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatthew Gregan <[email protected]>2021-07-24 23:37:17 +1200
committerMatthew Gregan <[email protected]>2021-07-27 16:11:10 +1200
commite1456788c48c5ed6b55bc107a7342d63f2a08413 (patch)
tree8b4920760ae707973caf976a2b490ea6039d27d1
parentf35db2358da6f52d77f0beece7b3d8b14722f650 (diff)
downloadcubeb-e1456788c48c5ed6b55bc107a7342d63f2a08413.tar.gz
cubeb-e1456788c48c5ed6b55bc107a7342d63f2a08413.zip
wasapi: Avoid a few copies in `wasapi_find_matching_output_device`.
See BMO #1722073.
-rw-r--r--src/cubeb_wasapi.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cubeb_wasapi.cpp b/src/cubeb_wasapi.cpp
index f6f7619..22a095a 100644
--- a/src/cubeb_wasapi.cpp
+++ b/src/cubeb_wasapi.cpp
@@ -2263,15 +2263,14 @@ void wasapi_find_matching_output_device(cubeb_stream * stm) {
// Find the input device, and then find the output device with the same group
// id and the same rate.
for (uint32_t i = 0; i < collection.count; i++) {
- cubeb_device_info dev = collection.device[i];
- if (dev.devid == input_device_id) {
- input_device = &dev;
+ if (collection.device[i].devid == input_device_id) {
+ input_device = &collection.device[i];
break;
}
}
for (uint32_t i = 0; i < collection.count; i++) {
- cubeb_device_info dev = collection.device[i];
+ cubeb_device_info & dev = collection.device[i];
if (dev.type == CUBEB_DEVICE_TYPE_OUTPUT && dev.group_id && input_device &&
!strcmp(dev.group_id, input_device->group_id) &&
dev.default_rate == input_device->default_rate) {