diff --git a/src/IO/configuration_config.cpp b/src/IO/configuration_config.cpp index a9fd834b85..f4922672f7 100644 --- a/src/IO/configuration_config.cpp +++ b/src/IO/configuration_config.cpp @@ -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); } diff --git a/src/IO/configuration_config.hpp b/src/IO/configuration_config.hpp index 9039a76440..a0e18a02be 100644 --- a/src/IO/configuration_config.hpp +++ b/src/IO/configuration_config.hpp @@ -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);