From 140252ffc0ae71e8b5309bff7d6550189c602702 Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Mon, 30 Sep 2024 17:26:50 -0700 Subject: Modernize `std::any_of` with ranges In WiimoteReal.cpp, JitRegCache.cpp, lambda predicates were replaced by pointers to member functions because ranges algorithms are able invoke those. In ConvertDialog.cpp, the `std::mem_fn` helper was removed because ranges algorithms are able to handle pointers to member functions as predicates. --- Source/Core/Common/Debug/MemoryPatches.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/Common/Debug/MemoryPatches.cpp') diff --git a/Source/Core/Common/Debug/MemoryPatches.cpp b/Source/Core/Common/Debug/MemoryPatches.cpp index d4f7e92379..3dee4d0e03 100644 --- a/Source/Core/Common/Debug/MemoryPatches.cpp +++ b/Source/Core/Common/Debug/MemoryPatches.cpp @@ -91,7 +91,7 @@ void MemoryPatches::DisablePatch(const Core::CPUThreadGuard& guard, std::size_t bool MemoryPatches::HasEnabledPatch(u32 address) const { - return std::any_of(m_patches.begin(), m_patches.end(), [address](const MemoryPatch& patch) { + return std::ranges::any_of(m_patches, [address](const MemoryPatch& patch) { return patch.address == address && patch.is_enabled == MemoryPatch::State::Enabled; }); } -- cgit v1.2.3