13
0

efficiency is overrated - don't cache the return value of user_config_directory_name() since it can be called with different arguments

This commit is contained in:
Paul Davis 2015-03-11 13:24:11 -05:00
parent f9ce27fd65
commit 59880b7fa3

View File

@ -50,7 +50,7 @@ user_config_directory_name (int version = -1)
}
const string config_dir_name = string_compose ("%1%2", X_(PROGRAM_NAME), version);
#if defined (__APPLE__) || defined (PLATFORM_WINDOWS)
return config_dir_name;
#else
@ -61,9 +61,7 @@ user_config_directory_name (int version = -1)
std::string
user_config_directory (int version)
{
static std::string p;
if (!p.empty()) return p;
std::string p;
#ifdef __APPLE__