From c14129eb57afe1186c63f94b06f3e383ea8b19de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 4 Nov 2025 12:04:49 +0100 Subject: [PATCH] Fix order of checks in hleDoLog, minor perf improvement --- Core/Config.cpp | 10 +++------- Core/Config.h | 3 ++- Core/HLE/HLE.h | 8 ++++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Core/Config.cpp b/Core/Config.cpp index ce3ef21856..ab42a9ead1 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1149,10 +1149,6 @@ bool Config::LoadAppendedConfig() { return true; } -void Config::SetAppendedConfigIni(const Path &path) { - appendedConfigFileName_ = path; -} - void Config::UpdateAfterSettingAutoFrameSkip() { if (bAutoFrameSkip && iFrameSkip == 0) { iFrameSkip = 1; @@ -1848,11 +1844,11 @@ bool PlayTimeTracker::GetPlayedTimeString(const std::string &gameId, std::string } int totalSeconds = iter->second.totalTimePlayed; - int seconds = totalSeconds % 60; + const int seconds = totalSeconds % 60; totalSeconds /= 60; - int minutes = totalSeconds % 60; + const int minutes = totalSeconds % 60; totalSeconds /= 60; - int hours = totalSeconds; + const int hours = totalSeconds; *str = ApplySafeSubstitutions(ga->T("Time Played: %1h %2m %3s"), hours, minutes, seconds); return true; diff --git a/Core/Config.h b/Core/Config.h index 69dbfd0d43..ad3442f75e 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -18,6 +18,7 @@ #pragma once #include +#include #include #include @@ -652,7 +653,7 @@ public: } bool LoadAppendedConfig(); - void SetAppendedConfigIni(const Path &path); + void SetAppendedConfigIni(const Path &path) { appendedConfigFileName_ = path; } void UpdateAfterSettingAutoFrameSkip(); void NotifyUpdatedCpuCore(); diff --git a/Core/HLE/HLE.h b/Core/HLE/HLE.h index 2a71089264..3c18ff2e47 100644 --- a/Core/HLE/HLE.h +++ b/Core/HLE/HLE.h @@ -235,6 +235,10 @@ template [[nodiscard]] NO_INLINE T hleDoLog(Log t, LogLevel level, T res, const char *file, int line, const char *reportTag) { + if (convert_code && (int)res >= 0) { + level = LogLevel::LDEBUG; + } + if (((int)level > MAX_LOGLEVEL || !GenericLogEnabled(t, level)) && !reportTag) { if (leave) { hleLeave(); @@ -242,10 +246,6 @@ T hleDoLog(Log t, LogLevel level, T res, const char *file, int line, const char return res; } - if (convert_code && (int)res >= 0) { - level = LogLevel::LDEBUG; - } - u64 fmtRes = res; if (std::is_floating_point::value) { // We reinterpret as the bits for now, so we can have a common helper.