better code style

This commit is contained in:
ngxson 2024-05-24 00:27:50 +02:00
parent e0a2d830ca
commit 43321db396

View file

@ -1863,7 +1863,7 @@ std::string fs_get_cache_directory() {
return p; return p;
}; };
if (getenv("LLAMA_CACHE")) { if (getenv("LLAMA_CACHE")) {
cache_directory = ensure_trailing_slash(std::getenv("LLAMA_CACHE")); cache_directory = std::getenv("LLAMA_CACHE");
} else { } else {
#ifdef __linux__ #ifdef __linux__
if (std::getenv("XDG_CACHE_HOME")) { if (std::getenv("XDG_CACHE_HOME")) {
@ -1878,9 +1878,8 @@ std::string fs_get_cache_directory() {
#endif // __linux__ #endif // __linux__
cache_directory = ensure_trailing_slash(cache_directory); cache_directory = ensure_trailing_slash(cache_directory);
cache_directory += "llama.cpp"; cache_directory += "llama.cpp";
cache_directory += DIRECTORY_SEPARATOR;
} }
return cache_directory; return ensure_trailing_slash(cache_directory);
} }