From 4838f72e50499fae4ba8e84fafab6e768f830cd2 Mon Sep 17 00:00:00 2001 From: JohnHolmesII Date: Sat, 11 Apr 2020 13:14:50 -0700 Subject: [PATCH] Prevent unecessary copy in loop --- rpcs3/Input/evdev_joystick_handler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/Input/evdev_joystick_handler.cpp b/rpcs3/Input/evdev_joystick_handler.cpp index a29ab8362f..d5471a3e45 100644 --- a/rpcs3/Input/evdev_joystick_handler.cpp +++ b/rpcs3/Input/evdev_joystick_handler.cpp @@ -217,7 +217,7 @@ std::unordered_map> evdev_joystick_handler::GetButtonV if (!Init()) return button_values; - for (const auto entry : button_list) + for (const auto& entry : button_list) { const auto code = entry.first; int val = 0; @@ -228,7 +228,7 @@ std::unordered_map> evdev_joystick_handler::GetButtonV button_values.emplace(code, std::make_pair(static_cast(val > 0 ? 255 : 0), false)); } - for (const auto entry : axis_list) + for (const auto& entry : axis_list) { const auto code = entry.first; int val = 0;