New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FileSearch: Don't use RegExes, just do string comparisons. #3075
Conversation
} | ||
regex_str += ")$"; | ||
std::regex regex(regex_str, std::regex_constants::icase); | ||
bool accept_all = (exts.size() == 0) || (std::find(exts.begin(), exts.end(), "") != exts.end()); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
2595fd9
to
ff2e0e3
Compare
@@ -162,7 +162,7 @@ void InterfaceConfigPane::LoadGUIValues() | |||
|
|||
void InterfaceConfigPane::LoadThemes() | |||
{ | |||
auto sv = DoFileSearch({"*"}, { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
why, why, why do we care about GCC < 4.9 :( but I guess it isn't the end of the world if it wasn't being used anyway. |
This should be a performance boost (though it may not be too noticeable) as well as supporting GCC < 4.9. And I want this to get Dolphin working on Haiku, as Haiku finally has EGL support, but is still on GCC 4.8 for the time being. |
Sorry, clarification - it'll only be a performance boost if the regex evaluator doesn't have a JIT. I'm not aware of any implementations that do have a JIT right now. |
If you want to support GCC 4.8, aren't there more things you need to change? For instance, PR #2674 (and |
It's not a performance boost because the cost of doing a filename comparison is negligible - only the time it takes the OS to hand over the directory listing matters. I guess 17 months isn't that long for Haiku to drag feet... |
Hmm, not sure. I know that SymbolDB at least compiled on the offline WIP I have with no errors or warnings, so I don't know... |
@JosJuice: It appears GCC 4.8 does have it: http://stackoverflow.com/questions/24389014/stdmap-emplace-gcc-4-8-2 |
Even if it didn't, it wouldn't be reverted just to support Haiku. |
I realize that. |
ff2e0e3
to
110987b
Compare
@comex fixed. |
return true; | ||
std::string name = entry.virtualName; | ||
std::transform(name.begin(), name.end(), name.begin(), ::tolower); | ||
return std::any_of(exts.begin(), exts.end(), [&](std::string ext) { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Nothing used the RegEx feature of FileSearch, and GCC < 4.9 doesn't support C++11 RegEx properly, so get rid of it.
110987b
to
06c6f60
Compare
@lioncash fixed. |
No guarantee that gcc 4.8 will stay supported in the future, but LGTM. |
FileSearch: Don't use RegExes, just do string comparisons.
Nothing used the RegEx feature of FileSearch, and GCC < 4.9 doesn't support C++11 RegEx properly, so get rid of it.
CC @comex as he wrote the feature & @lioncash for code review