Skip to content

Commit

Permalink
Inline code of update_datadir
Browse files Browse the repository at this point in the history
It is only called from one place anyway.
  • Loading branch information
BevapDin committed Nov 17, 2019
1 parent 50a2aa1 commit 6d23012
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/path_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
static std::string find_translated_file( const std::string &path, const std::string &extension,
const std::string &fallback );

static void update_datadir();
static void update_config_dir();

static std::string motd_value;
Expand Down Expand Up @@ -80,15 +79,6 @@ void PATH_INFO::init_user_dir( const char *ud )
user_dir_value = dir;
}

void update_datadir()
{
// Shared dirs
gfxdir_value = datadir_value + "gfx/";

// Shared files
motd_value = datadir_value + "motd/" + "en.motd";
}

void update_config_dir()
{
options_value = config_dir_value + "options.json";
Expand Down Expand Up @@ -421,7 +411,11 @@ std::string PATH_INFO::names()
void PATH_INFO::set_datadir( const std::string &datadir )
{
datadir_value = datadir;
update_datadir();
// Shared dirs
gfxdir_value = datadir_value + "gfx/";

// Shared files
motd_value = datadir_value + "motd/" + "en.motd";
}

void PATH_INFO::set_config_dir( const std::string &config_dir )
Expand Down

0 comments on commit 6d23012

Please sign in to comment.