Skip to content

Commit 95811b5

Browse files
committed
IO/config: return constant references whenever possible
1 parent 0c2b28a commit 95811b5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/IO/configuration_config.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ bool Config::hasOption(const std::string &key) const
151151
\param key is the name of the option
152152
\result The specified option.
153153
*/
154-
std::string Config::get(const std::string &key) const
154+
const std::string & Config::get(const std::string &key) const
155155
{
156156
return m_options->at(key);
157157
}

src/IO/configuration_config.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Config
5858
Options & getOptions();
5959
const Options & getOptions() const;
6060
bool hasOption(const std::string &key) const;
61-
std::string get(const std::string &key) const;
61+
const std::string & get(const std::string &key) const;
6262
std::string get(const std::string &key, const std::string &fallback) const;
6363
void set(const std::string &key, const std::string &value);
6464
bool removeOption(const std::string &key);

0 commit comments

Comments
 (0)