Prevent unecessary copy in loop

This commit is contained in:
JohnHolmesII 2020-04-11 13:14:50 -07:00 committed by Ivan
parent a8a83c9724
commit 4838f72e50

View File

@ -217,7 +217,7 @@ std::unordered_map<u64, std::pair<u16, bool>> 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<u64, std::pair<u16, bool>> evdev_joystick_handler::GetButtonV
button_values.emplace(code, std::make_pair<u16, bool>(static_cast<u16>(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;