mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-28 07:18:33 +00: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:
parent
c40a9b1f12
commit
063d9894b7
27 changed files with 42 additions and 51 deletions
|
@ -495,10 +495,8 @@ public:
|
|||
ControlState GetValue() const override
|
||||
{
|
||||
// True if we have no modifiers
|
||||
const bool modifiers_pressed = std::all_of(m_modifiers.begin(), m_modifiers.end(),
|
||||
[](const std::unique_ptr<ControlExpression>& input) {
|
||||
return input->GetValue() > CONDITION_THRESHOLD;
|
||||
});
|
||||
const bool modifiers_pressed = std::ranges::all_of(
|
||||
m_modifiers, [](const auto& input) { return input->GetValue() > CONDITION_THRESHOLD; });
|
||||
|
||||
const auto final_input_state = m_final_input->GetValueIgnoringSuppression();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue