From 26c84718c86272a9049945ade3bae19acc459cf3 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 17 Oct 2019 18:15:39 -0400 Subject: [PATCH] hid/npad: Replace std::for_each with ranged for loops Performs the same behavior, but is built into the core language itself. No functional change. --- src/core/hle/service/hid/controllers/npad.cpp | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index ed31b3bad2..27fc7a79b7 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp @@ -629,25 +629,24 @@ void Controller_NPad::ClearAllConnectedControllers() { } void Controller_NPad::DisconnectAllConnectedControllers() { - std::for_each(connected_controllers.begin(), connected_controllers.end(), - [](ControllerHolder& controller) { controller.is_connected = false; }); + for (ControllerHolder& controller : connected_controllers) { + controller.is_connected = false; + } } void Controller_NPad::ConnectAllDisconnectedControllers() { - std::for_each(connected_controllers.begin(), connected_controllers.end(), - [](ControllerHolder& controller) { - if (controller.type != NPadControllerType::None && !controller.is_connected) { - controller.is_connected = false; - } - }); + for (ControllerHolder& controller : connected_controllers) { + if (controller.type != NPadControllerType::None && !controller.is_connected) { + controller.is_connected = false; + } + } } void Controller_NPad::ClearAllControllers() { - std::for_each(connected_controllers.begin(), connected_controllers.end(), - [](ControllerHolder& controller) { - controller.type = NPadControllerType::None; - controller.is_connected = false; - }); + for (ControllerHolder& controller : connected_controllers) { + controller.type = NPadControllerType::None; + controller.is_connected = false; + } } u32 Controller_NPad::GetAndResetPressState() {