mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Modernize std::all_of
with ranges
In DITSpecification.cpp, MaterialAsset.cpp, and ShaderAsset.cpp, lambda predicates were replaced by pointers to member functions because ranges algorithms are able invoke those. In NetPlayClient.cpp, the non-trivial `NetPlay::Player` elements were being passed by value in `NetPlayClient::DoAllPlayersHaveGame()`. This has been fixed. In WIABlob.cpp, the second example's predicate was returning the `std::optional` by value instead of implicitly converting it to a bool. This has been fixed.
This commit is contained in:
@ -25,8 +25,8 @@ IMUAccelerometer::IMUAccelerometer(std::string name_, std::string ui_name_)
|
||||
|
||||
bool IMUAccelerometer::AreInputsBound() const
|
||||
{
|
||||
return std::all_of(controls.begin(), controls.end(),
|
||||
[](const auto& control) { return control->control_ref->BoundCount() > 0; });
|
||||
return std::ranges::all_of(
|
||||
controls, [](const auto& control) { return control->control_ref->BoundCount() > 0; });
|
||||
}
|
||||
|
||||
std::optional<IMUAccelerometer::StateData> IMUAccelerometer::GetState() const
|
||||
|
Reference in New Issue
Block a user