diff options
| author | Dentomologist <dentomologist@gmail.com> | 2022-05-27 14:25:43 -0700 |
|---|---|---|
| committer | Dentomologist <dentomologist@gmail.com> | 2022-05-31 16:18:08 -0700 |
| commit | c2be78079c96440edf672c1bce9ebfafcb4ec283 (patch) | |
| tree | ccc689d149642c6ad2285d61702e2373f266927b | |
| parent | 4d563ce4d15d4cf67e00549d320f5350f7494e93 (diff) | |
FileUtil: Remove GetSysDirectory log spam
Create and log path the first time GetSysDirectory is called, then just
return the path on future calls.
| -rw-r--r-- | Source/Core/Common/FileUtil.cpp | 10 | ||||
| -rw-r--r-- | Source/Core/Common/FileUtil.h | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index 8e42e0f42e..5707507a42 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -885,7 +885,7 @@ std::string GetExeDirectory() #endif } -std::string GetSysDirectory() +static std::string CreateSysDirectoryPath() { std::string sysDir; @@ -913,10 +913,16 @@ std::string GetSysDirectory() #endif sysDir += DIR_SEP; - INFO_LOG_FMT(COMMON, "GetSysDirectory: Setting to {}:", sysDir); + INFO_LOG_FMT(COMMON, "CreateSysDirectoryPath: Setting to {}", sysDir); return sysDir; } +const std::string& GetSysDirectory() +{ + static const std::string sys_directory = CreateSysDirectoryPath(); + return sys_directory; +} + #ifdef ANDROID void SetSysDirectory(const std::string& path) { diff --git a/Source/Core/Common/FileUtil.h b/Source/Core/Common/FileUtil.h index 0542cb3402..2672e237de 100644 --- a/Source/Core/Common/FileUtil.h +++ b/Source/Core/Common/FileUtil.h @@ -215,7 +215,7 @@ void SetUserPath(unsigned int dir_index, std::string path); std::string GetThemeDir(const std::string& theme_name); // Returns the path to where the sys file are -std::string GetSysDirectory(); +const std::string& GetSysDirectory(); #ifdef ANDROID void SetSysDirectory(const std::string& path); |
