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 Oct 25, 2023
1 parent 6c6752e commit 720e1cc
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 @@ -213,7 +213,7 @@ void Config::set(const std::string &key, const std::string &value)
\param name is the name of the attribute
\result The value of the specified attribute.
*/
std::string Config::getAttribute(const std::string &key, const std::string &name) const
const std::string & Config::getAttribute(const std::string &key, const std::string &name) const
{
return getOption(key).attributes.at(name);
}
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 @@ -67,7 +67,7 @@ class Config
std::string get(const std::string &key, const std::string &fallback) const;
void set(const std::string &key, const std::string &value);

std::string getAttribute(const std::string &key, const std::string &name) const;
const std::string & getAttribute(const std::string &key, const std::string &name) const;
std::string getAttribute(const std::string &key, const std::string &name, const std::string &fallback) const;
void setAttribute(const std::string &key, const std::string &name, const std::string &value);

Expand Down

0 comments on commit 720e1cc

Please sign in to comment.