Skip to content

Commit

Permalink
Remove duplicate fs calls
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat authored Dec 26, 2024
1 parent d24b780 commit 6a41065
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/emulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ std::filesystem::path Emulator::getConfigPath() {
if constexpr (Helpers::isAndroid()) {
return getAndroidAppPath() / "config.toml";
} else {
if (std::filesystem::exists(std::filesystem::current_path() / "config.toml")) {
return std::filesystem::current_path() / "config.toml";
std::filesystem::path localPath = std::filesystem::current_path() / "config.toml");

if (std::filesystem::exists(localPath)) {
return localPath;
} else {
return getAppDataRoot() / "config.toml";
}
Expand Down Expand Up @@ -472,4 +474,4 @@ void Emulator::reloadSettings() {
}
}
#endif
}
}

0 comments on commit 6a41065

Please sign in to comment.