mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-07-04 23:31:19 +01:00
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:
parent
e433e99191
commit
26c84718c8
1 changed files with 12 additions and 13 deletions
|
@ -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() {
|
||||||
|
|
Loading…
Reference in a new issue