mirror of
https://github.com/decompals/wibo.git
synced 2025-07-05 20:55:51 +00:00
findNextFile improvement (#82)
* move empty pattern check into while loop * early return if pattern is empty * comment
This commit is contained in:
parent
93862405ed
commit
c01d9a25b9
@ -701,10 +701,15 @@ namespace kernel32 {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Early return if pattern is empty
|
||||
if (handle->pattern.empty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Look for a matching file with the pattern
|
||||
while (handle->it != std::filesystem::directory_iterator()) {
|
||||
std::filesystem::path path = *handle->it;
|
||||
if (!handle->pattern.empty() && fnmatch(handle->pattern.c_str(), path.filename().c_str(), 0) == 0) {
|
||||
if (fnmatch(handle->pattern.c_str(), path.filename().c_str(), 0) == 0) {
|
||||
return true;
|
||||
}
|
||||
handle->it++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user