From 6a41065499d10486e0154b29e1d0bca070acb051 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Thu, 26 Dec 2024 23:03:17 +0200 Subject: [PATCH] Remove duplicate fs calls --- src/emulator.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/emulator.cpp b/src/emulator.cpp index a0693fd4..18f7c023 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -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"; } @@ -472,4 +474,4 @@ void Emulator::reloadSettings() { } } #endif -} \ No newline at end of file +}