diff options
| author | shuffle2 <godisgovernment@gmail.com> | 2017-06-27 12:36:16 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-27 12:36:16 -0700 |
| commit | 951f6400fba1401476e787f0b87518afac4d8f10 (patch) | |
| tree | 01d946e58663b0ba3f224c315355a63f5bc20e04 /Source/Core/Common/FileSearch.cpp | |
| parent | 0ea17dafd9ce035886dd2ebbdce18b1f0ea4dd56 (diff) | |
| parent | 7992c786b9de692bc71e00996f55153320aea1e5 (diff) | |
Merge pull request #5706 from JosJuice/more-gamelist-speedup-followup
More follow-up for the gamelist speedup PR
Diffstat (limited to 'Source/Core/Common/FileSearch.cpp')
| -rw-r--r-- | Source/Core/Common/FileSearch.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Core/Common/FileSearch.cpp b/Source/Core/Common/FileSearch.cpp index 4b3b0820d2..cca5c095f7 100644 --- a/Source/Core/Common/FileSearch.cpp +++ b/Source/Core/Common/FileSearch.cpp @@ -14,6 +14,8 @@ namespace fs = std::experimental::filesystem; #define HAS_STD_FILESYSTEM #else +#include <cstring> +#include "Common/CommonFuncs.h" #include "Common/FileUtil.h" #endif @@ -55,11 +57,10 @@ std::vector<std::string> DoFileSearch(const std::vector<std::string>& directorie return true; if (entry.isDirectory) return false; - std::string name = entry.virtualName; - std::transform(name.begin(), name.end(), name.begin(), ::tolower); return std::any_of(exts.begin(), exts.end(), [&](const std::string& ext) { + const std::string& name = entry.virtualName; return name.length() >= ext.length() && - name.compare(name.length() - ext.length(), ext.length(), ext) == 0; + strcasecmp(name.c_str() + name.length() - ext.length(), ext.c_str()) == 0; }); }); } |
