diff --git a/Source/Android/jni/Cheats/GraphicsModGroup.cpp b/Source/Android/jni/Cheats/GraphicsModGroup.cpp index 35a5a92f08..7affca0ef6 100644 --- a/Source/Android/jni/Cheats/GraphicsModGroup.cpp +++ b/Source/Android/jni/Cheats/GraphicsModGroup.cpp @@ -51,10 +51,9 @@ Java_org_dolphinemu_dolphinemu_features_cheats_model_GraphicsModGroup_getMods(JN for (GraphicsModConfig& mod : mod_group->GetMods()) { // If no group matches the mod's features, or if the mod has no features, skip it - if (std::none_of(mod.m_features.begin(), mod.m_features.end(), - [&groups](const GraphicsModFeatureConfig& feature) { - return groups.contains(feature.m_group); - })) + if (std::ranges::none_of(mod.m_features, [&groups](const GraphicsModFeatureConfig& feature) { + return groups.contains(feature.m_group); + })) { continue; } diff --git a/Source/Core/Common/NandPaths.cpp b/Source/Core/Common/NandPaths.cpp index 35c5eac689..65d18d0c70 100644 --- a/Source/Core/Common/NandPaths.cpp +++ b/Source/Core/Common/NandPaths.cpp @@ -171,6 +171,6 @@ std::string UnescapeFileName(const std::string& filename) bool IsFileNameSafe(const std::string_view filename) { return !filename.empty() && !std::ranges::all_of(filename, [](char c) { return c == '.'; }) && - std::none_of(filename.begin(), filename.end(), IsIllegalCharacter); + std::ranges::none_of(filename, IsIllegalCharacter); } } // namespace Common diff --git a/Source/Core/Core/PowerPC/Jit64/RegCache/JitRegCache.cpp b/Source/Core/Core/PowerPC/Jit64/RegCache/JitRegCache.cpp index c1b8b63adf..f1827b0f5d 100644 --- a/Source/Core/Core/PowerPC/Jit64/RegCache/JitRegCache.cpp +++ b/Source/Core/Core/PowerPC/Jit64/RegCache/JitRegCache.cpp @@ -369,10 +369,8 @@ RCForkGuard RegCache::Fork() void RegCache::Discard(BitSet32 pregs) { - ASSERT_MSG( - DYNA_REC, - std::none_of(m_xregs.begin(), m_xregs.end(), [](const auto& x) { return x.IsLocked(); }), - "Someone forgot to unlock a X64 reg"); + ASSERT_MSG(DYNA_REC, std::ranges::none_of(m_xregs, &X64CachedReg::IsLocked), + "Someone forgot to unlock a X64 reg"); for (preg_t i : pregs) { @@ -393,10 +391,8 @@ void RegCache::Discard(BitSet32 pregs) void RegCache::Flush(BitSet32 pregs, IgnoreDiscardedRegisters ignore_discarded_registers) { - ASSERT_MSG( - DYNA_REC, - std::none_of(m_xregs.begin(), m_xregs.end(), [](const auto& x) { return x.IsLocked(); }), - "Someone forgot to unlock a X64 reg"); + ASSERT_MSG(DYNA_REC, std::ranges::none_of(m_xregs, &X64CachedReg::IsLocked), + "Someone forgot to unlock a X64 reg"); for (preg_t i : pregs) { @@ -459,9 +455,8 @@ void RegCache::Commit() bool RegCache::IsAllUnlocked() const { - return std::none_of(m_regs.begin(), m_regs.end(), [](const auto& r) { return r.IsLocked(); }) && - std::none_of(m_xregs.begin(), m_xregs.end(), [](const auto& x) { return x.IsLocked(); }) && - !IsAnyConstraintActive(); + return std::ranges::none_of(m_regs, &PPCCachedReg::IsLocked) && + std::ranges::none_of(m_xregs, &X64CachedReg::IsLocked) && !IsAnyConstraintActive(); } void RegCache::PreloadRegisters(BitSet32 to_preload) diff --git a/Source/Core/DolphinQt/Config/GraphicsModListWidget.cpp b/Source/Core/DolphinQt/Config/GraphicsModListWidget.cpp index 4eb1bb69a6..5bd1166d32 100644 --- a/Source/Core/DolphinQt/Config/GraphicsModListWidget.cpp +++ b/Source/Core/DolphinQt/Config/GraphicsModListWidget.cpp @@ -138,10 +138,9 @@ void GraphicsModListWidget::RefreshModList() for (const GraphicsModConfig& mod : m_mod_group.GetMods()) { // If no group matches the mod's features, or if the mod has no features, skip it - if (std::none_of(mod.m_features.begin(), mod.m_features.end(), - [&groups](const GraphicsModFeatureConfig& feature) { - return groups.contains(feature.m_group); - })) + if (std::ranges::none_of(mod.m_features, [&groups](const GraphicsModFeatureConfig& feature) { + return groups.contains(feature.m_group); + })) { continue; } diff --git a/Source/Core/DolphinQt/ConvertDialog.cpp b/Source/Core/DolphinQt/ConvertDialog.cpp index e13463806b..5e29463117 100644 --- a/Source/Core/DolphinQt/ConvertDialog.cpp +++ b/Source/Core/DolphinQt/ConvertDialog.cpp @@ -248,9 +248,8 @@ void ConvertDialog::OnFormatChanged() m_compression->setEnabled(m_compression->count() > 1); // Block scrubbing of RVZ containers and Datel discs - const bool scrubbing_allowed = - format != DiscIO::BlobType::RVZ && - std::none_of(m_files.begin(), m_files.end(), std::mem_fn(&UICommon::GameFile::IsDatelDisc)); + const bool scrubbing_allowed = format != DiscIO::BlobType::RVZ && + std::ranges::none_of(m_files, &UICommon::GameFile::IsDatelDisc); m_scrub->setEnabled(scrubbing_allowed); if (!scrubbing_allowed) diff --git a/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp b/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp index dd897c2535..7fdf677a91 100644 --- a/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp +++ b/Source/Core/InputCommon/ControlReference/ExpressionParser.cpp @@ -305,9 +305,10 @@ bool HotkeySuppressions::IsSuppressedIgnoringModifiers(Device::Input* input, return i1 && i2 && (i1 == i2 || i1->IsChild(i2) || i2->IsChild(i1)); }; - return std::any_of(it, it_end, [&](auto& s) { - return std::none_of(begin(ignore_modifiers), end(ignore_modifiers), - [&](auto& m) { return is_same_modifier(m->GetInput(), s.first.second); }); + return std::any_of(it, it_end, [&](const auto& s) { + return std::ranges::none_of(ignore_modifiers, [&](const auto& m) { + return is_same_modifier(m->GetInput(), s.first.second); + }); }); } diff --git a/Source/Core/VideoCommon/BoundingBox.cpp b/Source/Core/VideoCommon/BoundingBox.cpp index 33174012d7..94e7eaa18c 100644 --- a/Source/Core/VideoCommon/BoundingBox.cpp +++ b/Source/Core/VideoCommon/BoundingBox.cpp @@ -34,7 +34,7 @@ void BoundingBox::Flush() m_is_valid = false; - if (std::none_of(m_dirty.begin(), m_dirty.end(), [](bool dirty) { return dirty; })) + if (std::ranges::none_of(m_dirty, std::identity{})) return; // TODO: Does this make any difference over just writing all the values?