summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2024-07-08 18:15:23 +0200
committerJosJuice <josjuice@gmail.com>2024-07-09 09:55:51 +0200
commite6b9091ffce7f87e241aef8818e7cd0ee4053782 (patch)
tree545e2bb5a958106fce952776f1fb0b27075b97ca /Source/Core
parentf59678842b9614969be0813e54d25f6c35e0de63 (diff)
RetroAchievements: Skip LoadApprovedList if there are no patches
There being no active patches is by far the most common case, so let's optimize for this case.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/AchievementManager.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/Core/AchievementManager.cpp b/Source/Core/Core/AchievementManager.cpp
index d4ee8a0add..7a1837abbc 100644
--- a/Source/Core/Core/AchievementManager.cpp
+++ b/Source/Core/Core/AchievementManager.cpp
@@ -361,6 +361,12 @@ bool AchievementManager::IsHardcoreModeActive() const
void AchievementManager::FilterApprovedPatches(std::vector<PatchEngine::Patch>& patches,
const std::string& game_ini_id) const
{
+ if (patches.empty())
+ {
+ // There's nothing to verify, so let's save ourselves some work
+ return;
+ }
+
std::lock_guard lg{m_lock};
if (!IsHardcoreModeActive())