Skip to content

Commit

Permalink
IO/config: return constant references whenever possible
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-iob committed Sep 23, 2022
1 parent 311530d commit cb637bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/IO/configuration_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ bool Config::hasOption(const std::string &key) const
\param key is the name of the option
\result The specified option.
*/
std::string Config::get(const std::string &key) const
const std::string & Config::get(const std::string &key) const
{
return m_options->at(key);
}
Expand Down
2 changes: 1 addition & 1 deletion src/IO/configuration_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Config
Options & getOptions();
const Options & getOptions() const;
bool hasOption(const std::string &key) const;
std::string get(const std::string &key) const;
const std::string & get(const std::string &key) const;
std::string get(const std::string &key, const std::string &fallback) const;
void set(const std::string &key, const std::string &value);
bool removeOption(const std::string &key);
Expand Down

0 comments on commit cb637bd

Please sign in to comment.