Fix order of checks in hleDoLog, minor perf improvement

This commit is contained in:
Henrik Rydgård committed 2025-11-04 13:35:45 +01:00
1 parent 607451fe6a
commit c14129eb57
3 files changed
+9 -12

No files matched your search

+3 -7
View File
@@ -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;
+2 -1
View File
@@ -18,6 +18,7 @@
#pragma once
#include <string>
#include <string_view>
#include <map>
#include <vector>
@@ -652,7 +653,7 @@ public:
}
bool LoadAppendedConfig();
void SetAppendedConfigIni(const Path &path);
void SetAppendedConfigIni(const Path &path) { appendedConfigFileName_ = path; }
void UpdateAfterSettingAutoFrameSkip();
void NotifyUpdatedCpuCore();
+4 -4
View File
@@ -235,6 +235,10 @@ template <bool leave, bool convert_code, typename T>
[[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<T>::value) {
// We reinterpret as the bits for now, so we can have a common helper.