diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2020-08-21 18:04:50 -0700 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2020-08-23 13:57:05 -0700 |
| commit | 181e0dba21b78a23df9a459fc01b870ccf0466e9 (patch) | |
| tree | 33344ac81bd0a91d190c24233046b3ceab2ed5da /Source/Core/Common/FileSearch.cpp | |
| parent | ccbc4c2d991cd42dbc2943aebe617d31b2c74a59 (diff) | |
apply `if constexpr` in a couple places
Diffstat (limited to 'Source/Core/Common/FileSearch.cpp')
| -rw-r--r-- | Source/Core/Common/FileSearch.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/Core/Common/FileSearch.cpp b/Source/Core/Common/FileSearch.cpp index ff2de8eb3b..bbcdc12026 100644 --- a/Source/Core/Common/FileSearch.cpp +++ b/Source/Core/Common/FileSearch.cpp @@ -125,9 +125,11 @@ std::vector<std::string> DoFileSearch(const std::vector<std::string>& directorie // std::filesystem uses the OS separator. constexpr fs::path::value_type os_separator = fs::path::preferred_separator; static_assert(os_separator == DIR_SEP_CHR || os_separator == '\\', "Unsupported path separator"); - if (os_separator != DIR_SEP_CHR) + if constexpr (os_separator != DIR_SEP_CHR) + { for (auto& path : result) std::replace(path.begin(), path.end(), '\\', DIR_SEP_CHR); + } return result; } |
