mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-07-10 01:24:41 -06:00
More optimized
This commit is contained in:
parent
ac7b7add27
commit
9002a7c914
@ -5,6 +5,7 @@ std::optional<fs::path> findPathCI(const fs::path& path)
|
||||
if (fs::exists(path)) return path;
|
||||
if (!path.has_parent_path()) return {};
|
||||
auto parentPath = path.parent_path();
|
||||
std::string fName = path.filename().string();
|
||||
if (!fs::exists(parentPath))
|
||||
{
|
||||
auto tempParentPath = findPathCI(parentPath);
|
||||
@ -12,13 +13,10 @@ std::optional<fs::path> findPathCI(const fs::path& path)
|
||||
parentPath = std::move(tempParentPath.value());
|
||||
else
|
||||
return {};
|
||||
if (fs::exists(parentPath / fName))
|
||||
return parentPath / fName;
|
||||
}
|
||||
|
||||
std::string fName = path.filename().string();
|
||||
|
||||
if (fs::exists(parentPath / fName))
|
||||
return parentPath / fName;
|
||||
|
||||
std::error_code listErr;
|
||||
for (auto&& dirEntry: fs::directory_iterator(parentPath, listErr))
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user