Browse Source

paths.cpp: Remove `AppPath`

It was redundant.
pull/3772/head
Gleb Mazovetskiy 4 years ago
parent
commit
d3a523fa0b
  1. 13
      Source/utils/paths.cpp
  2. 1
      Source/utils/paths.h

13
Source/utils/paths.cpp

@ -20,7 +20,6 @@ namespace paths {
namespace {
std::optional<std::string> appPath;
std::optional<std::string> basePath;
std::optional<std::string> prefPath;
std::optional<std::string> 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;
}

1
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();

Loading…
Cancel
Save