mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
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`.
This commit is contained in:
@ -63,8 +63,7 @@ const std::vector<MemoryPatch>& 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;
|
||||
|
Reference in New Issue
Block a user