diff options
| author | Dentomologist <dentomologist@gmail.com> | 2022-05-27 23:49:28 -0700 |
|---|---|---|
| committer | Dentomologist <dentomologist@gmail.com> | 2022-05-31 16:18:08 -0700 |
| commit | e0c9ae16b97a32ef4b778729200e4a9e552ce665 (patch) | |
| tree | 2958088109f69c46720f950932275c1c62cafd3e /Source/Core/Common/FileUtil.cpp | |
| parent | c2be78079c96440edf672c1bce9ebfafcb4ec283 (diff) | |
FileUtil: Refactor CreateSysDirectoryPath()
Diffstat (limited to 'Source/Core/Common/FileUtil.cpp')
| -rw-r--r-- | Source/Core/Common/FileUtil.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index 5707507a42..522d3028fa 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -887,8 +887,6 @@ std::string GetExeDirectory() static std::string CreateSysDirectoryPath() { - std::string sysDir; - #if defined(_WIN32) || defined(LINUX_LOCAL_DEV) #define SYSDATA_DIR "Sys" #elif defined __APPLE__ @@ -902,19 +900,18 @@ static std::string CreateSysDirectoryPath() #endif #if defined(__APPLE__) - sysDir = GetBundleDirectory() + DIR_SEP + SYSDATA_DIR; + const std::string sys_directory = GetBundleDirectory() + DIR_SEP SYSDATA_DIR DIR_SEP; #elif defined(_WIN32) || defined(LINUX_LOCAL_DEV) - sysDir = GetExeDirectory() + DIR_SEP + SYSDATA_DIR; + const std::string sys_directory = GetExeDirectory() + DIR_SEP SYSDATA_DIR DIR_SEP; #elif defined ANDROID - sysDir = s_android_sys_directory; - ASSERT_MSG(COMMON, !sysDir.empty(), "Sys directory has not been set"); + const std::string sys_directory = s_android_sys_directory + DIR_SEP; + ASSERT_MSG(COMMON, !s_android_sys_directory.empty(), "Sys directory has not been set"); #else - sysDir = SYSDATA_DIR; + const std::string sys_directory = SYSDATA_DIR DIR_SEP; #endif - sysDir += DIR_SEP; - INFO_LOG_FMT(COMMON, "CreateSysDirectoryPath: Setting to {}", sysDir); - return sysDir; + INFO_LOG_FMT(COMMON, "CreateSysDirectoryPath: Setting to {}", sys_directory); + return sys_directory; } const std::string& GetSysDirectory() |
