Small code tweak

This commit is contained in:
Maxime Coste 2014-12-20 18:40:17 +00:00
parent 116ea7364a
commit 5b94b73152
2 changed files with 3 additions and 4 deletions

View File

@ -227,12 +227,11 @@ void Client::check_buffer_fs_timestamp()
reload_buffer(context(), filename);
}
const String& Client::get_env_var(const String& name) const
StringView Client::get_env_var(const String& name) const
{
auto it = m_env_vars.find(name);
static String empty{};
if (it == m_env_vars.end())
return empty;
return {};
return it->second;
}

View File

@ -50,7 +50,7 @@ public:
void change_buffer(Buffer& buffer);
const String& get_env_var(const String& name) const;
StringView get_env_var(const String& name) const;
private:
void on_option_changed(const Option& option) override;