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); 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); auto it = m_env_vars.find(name);
static String empty{};
if (it == m_env_vars.end()) if (it == m_env_vars.end())
return empty; return {};
return it->second; return it->second;
} }

View File

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