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.
This commit is contained in:
Lioncash 2019-10-17 18:15:39 -04:00
parent e433e99191
commit 26c84718c8
1 changed files with 12 additions and 13 deletions

View File

@ -629,25 +629,24 @@ void Controller_NPad::ClearAllConnectedControllers() {
} }
void Controller_NPad::DisconnectAllConnectedControllers() { void Controller_NPad::DisconnectAllConnectedControllers() {
std::for_each(connected_controllers.begin(), connected_controllers.end(), for (ControllerHolder& controller : connected_controllers) {
[](ControllerHolder& controller) { controller.is_connected = false; }); controller.is_connected = false;
}
} }
void Controller_NPad::ConnectAllDisconnectedControllers() { void Controller_NPad::ConnectAllDisconnectedControllers() {
std::for_each(connected_controllers.begin(), connected_controllers.end(), for (ControllerHolder& controller : connected_controllers) {
[](ControllerHolder& controller) {
if (controller.type != NPadControllerType::None && !controller.is_connected) { if (controller.type != NPadControllerType::None && !controller.is_connected) {
controller.is_connected = false; controller.is_connected = false;
} }
}); }
} }
void Controller_NPad::ClearAllControllers() { void Controller_NPad::ClearAllControllers() {
std::for_each(connected_controllers.begin(), connected_controllers.end(), for (ControllerHolder& controller : connected_controllers) {
[](ControllerHolder& controller) {
controller.type = NPadControllerType::None; controller.type = NPadControllerType::None;
controller.is_connected = false; controller.is_connected = false;
}); }
} }
u32 Controller_NPad::GetAndResetPressState() { u32 Controller_NPad::GetAndResetPressState() {