From d3a523fa0b1b76f41b3a0d94193a447ea5443586 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Thu, 16 Dec 2021 18:55:55 +0000 Subject: [PATCH] paths.cpp: Remove `AppPath` It was redundant. --- Source/utils/paths.cpp | 13 ++----------- Source/utils/paths.h | 1 - 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Source/utils/paths.cpp b/Source/utils/paths.cpp index 5041f3751..c2f9b2341 100644 --- a/Source/utils/paths.cpp +++ b/Source/utils/paths.cpp @@ -20,7 +20,6 @@ namespace paths { namespace { -std::optional appPath; std::optional basePath; std::optional prefPath; std::optional configPath; @@ -51,18 +50,10 @@ std::string FromSDL(char *s) } // namespace -const std::string &AppPath() -{ - if (!appPath) { - appPath = FromSDL(SDL_GetBasePath()); - } - return *appPath; -} - const std::string &BasePath() { if (!basePath) { - basePath = AppPath(); + basePath = FromSDL(SDL_GetBasePath()); } return *basePath; } @@ -100,7 +91,7 @@ const std::string &ConfigPath() const std::string &AssetsPath() { if (!assetsPath) - assetsPath.emplace(AppPath() + "assets/"); + assetsPath.emplace(BasePath() + "assets/"); return *assetsPath; } diff --git a/Source/utils/paths.h b/Source/utils/paths.h index d20da7370..1a933ac0e 100644 --- a/Source/utils/paths.h +++ b/Source/utils/paths.h @@ -8,7 +8,6 @@ namespace devilution { namespace paths { -const std::string &AppPath(); const std::string &BasePath(); const std::string &PrefPath(); const std::string &ConfigPath();