summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/hid/emulated_controller.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index 74c877728..09f870eb0 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -432,7 +432,7 @@ std::vector<Common::ParamPackage> EmulatedController::GetMappedDevices(
432 continue; 432 continue;
433 } 433 }
434 const auto devices_it = std::find_if( 434 const auto devices_it = std::find_if(
435 devices.begin(), devices.end(), [param](const Common::ParamPackage param_) { 435 devices.begin(), devices.end(), [&param](const Common::ParamPackage& param_) {
436 return param.Get("engine", "") == param_.Get("engine", "") && 436 return param.Get("engine", "") == param_.Get("engine", "") &&
437 param.Get("guid", "") == param_.Get("guid", "") && 437 param.Get("guid", "") == param_.Get("guid", "") &&
438 param.Get("port", 0) == param_.Get("port", 0) && 438 param.Get("port", 0) == param_.Get("port", 0) &&
@@ -441,12 +441,12 @@ std::vector<Common::ParamPackage> EmulatedController::GetMappedDevices(
441 if (devices_it != devices.end()) { 441 if (devices_it != devices.end()) {
442 continue; 442 continue;
443 } 443 }
444 Common::ParamPackage device{}; 444
445 auto& device = devices.emplace_back();
445 device.Set("engine", param.Get("engine", "")); 446 device.Set("engine", param.Get("engine", ""));
446 device.Set("guid", param.Get("guid", "")); 447 device.Set("guid", param.Get("guid", ""));
447 device.Set("port", param.Get("port", 0)); 448 device.Set("port", param.Get("port", 0));
448 device.Set("pad", param.Get("pad", 0)); 449 device.Set("pad", param.Get("pad", 0));
449 devices.push_back(device);
450 } 450 }
451 451
452 for (const auto& param : stick_params) { 452 for (const auto& param : stick_params) {
@@ -457,7 +457,7 @@ std::vector<Common::ParamPackage> EmulatedController::GetMappedDevices(
457 continue; 457 continue;
458 } 458 }
459 const auto devices_it = std::find_if( 459 const auto devices_it = std::find_if(
460 devices.begin(), devices.end(), [param](const Common::ParamPackage param_) { 460 devices.begin(), devices.end(), [&param](const Common::ParamPackage& param_) {
461 return param.Get("engine", "") == param_.Get("engine", "") && 461 return param.Get("engine", "") == param_.Get("engine", "") &&
462 param.Get("guid", "") == param_.Get("guid", "") && 462 param.Get("guid", "") == param_.Get("guid", "") &&
463 param.Get("port", 0) == param_.Get("port", 0) && 463 param.Get("port", 0) == param_.Get("port", 0) &&
@@ -466,12 +466,12 @@ std::vector<Common::ParamPackage> EmulatedController::GetMappedDevices(
466 if (devices_it != devices.end()) { 466 if (devices_it != devices.end()) {
467 continue; 467 continue;
468 } 468 }
469 Common::ParamPackage device{}; 469
470 auto& device = devices.emplace_back();
470 device.Set("engine", param.Get("engine", "")); 471 device.Set("engine", param.Get("engine", ""));
471 device.Set("guid", param.Get("guid", "")); 472 device.Set("guid", param.Get("guid", ""));
472 device.Set("port", param.Get("port", 0)); 473 device.Set("port", param.Get("port", 0));
473 device.Set("pad", param.Get("pad", 0)); 474 device.Set("pad", param.Get("pad", 0));
474 devices.push_back(device);
475 } 475 }
476 return devices; 476 return devices;
477} 477}