From 62b2b939b5825e48c89b8a3ebb97d9fc38cb59e5 Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Sat, 21 Sep 2024 14:43:21 -0700 Subject: Simplify `std::find_if` with `std::ranges::find` and projections In LabelMap.cpp, the code is currently unused so I was unable to test it. In WiiUtils.cpp, the magic value `1u` was replaced by the constant value `DiscIO::PARTITION_UPDATE`. --- Source/Core/Common/Debug/MemoryPatches.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (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 3dee4d0e03..0becba1dde 100644 --- a/Source/Core/Common/Debug/MemoryPatches.cpp +++ b/Source/Core/Common/Debug/MemoryPatches.cpp @@ -63,8 +63,7 @@ const std::vector& MemoryPatches::GetPatches() const void MemoryPatches::UnsetPatch(const Core::CPUThreadGuard& guard, u32 address) { - const auto it = std::find_if(m_patches.begin(), m_patches.end(), - [address](const auto& patch) { return patch.address == address; }); + const auto it = std::ranges::find(m_patches, address, &MemoryPatch::address); if (it == m_patches.end()) return; -- cgit v1.2.3