Skip to content

Commit 720e1cc

Browse files
committed
IO/config: return constant references whenever possible
1 parent 6c6752e commit 720e1cc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/IO/configuration_config.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ void Config::set(const std::string &key, const std::string &value)
213213
\param name is the name of the attribute
214214
\result The value of the specified attribute.
215215
*/
216-
std::string Config::getAttribute(const std::string &key, const std::string &name) const
216+
const std::string & Config::getAttribute(const std::string &key, const std::string &name) const
217217
{
218218
return getOption(key).attributes.at(name);
219219
}

src/IO/configuration_config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Config
6767
std::string get(const std::string &key, const std::string &fallback) const;
6868
void set(const std::string &key, const std::string &value);
6969

70-
std::string getAttribute(const std::string &key, const std::string &name) const;
70+
const std::string & getAttribute(const std::string &key, const std::string &name) const;
7171
std::string getAttribute(const std::string &key, const std::string &name, const std::string &fallback) const;
7272
void setAttribute(const std::string &key, const std::string &name, const std::string &value);
7373

0 commit comments

Comments
 (0)