summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Debug/MemoryPatches.cpp
diff options
context:
space:
mode:
authorJoshuaMK <60854312+JoshuaMKW@users.noreply.github.com>2022-10-23 18:42:34 -0500
committerJoshuaMK <60854312+JoshuaMKW@users.noreply.github.com>2022-10-23 18:42:34 -0500
commit2594447c2589a2575d71129291151fb99b9a1f3f (patch)
treef8b1d80890d6540a37acdc8e433527f27a14d56e /Source/Core/Common/Debug/MemoryPatches.cpp
parente10b3308c2b5b046f138f534477068d857e2b5c8 (diff)
Have UnsetPatch only unset the argument address
Diffstat (limited to 'Source/Core/Common/Debug/MemoryPatches.cpp')
-rw-r--r--Source/Core/Common/Debug/MemoryPatches.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/Source/Core/Common/Debug/MemoryPatches.cpp b/Source/Core/Common/Debug/MemoryPatches.cpp
index cd44708e15..43ed9efd49 100644
--- a/Source/Core/Common/Debug/MemoryPatches.cpp
+++ b/Source/Core/Common/Debug/MemoryPatches.cpp
@@ -50,14 +50,8 @@ void MemoryPatches::UnsetPatch(u32 address)
if (it == m_patches.end())
return;
- const std::size_t size = m_patches.size();
- std::size_t index = size - std::distance(it, m_patches.end());
- while (index < size)
- {
- DisablePatch(index);
- ++index;
- }
- m_patches.erase(it, m_patches.end());
+ const std::size_t index = std::distance(m_patches.begin(), it);
+ RemovePatch(index);
}
void MemoryPatches::EnablePatch(std::size_t index)