diff options
| author | 2023-01-10 20:57:56 +0000 | |
|---|---|---|
| committer | 2023-01-10 21:27:18 +0000 | |
| commit | 1b2916c8451506adccf3ab0a56bbf836d9f3cb36 (patch) | |
| tree | 8675a6bf6fdf97b0f7dba5449fe59f1f669986a2 /src/configreader.cpp | |
| parent | Fix calling the base Set/Unset implementation in ListExtItem. (diff) | |
Avoid copying shared_ptr<ConfigTag> when not necessary.
Diffstat (limited to 'src/configreader.cpp')
| -rw-r--r-- | src/configreader.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp index db164c665..97a483411 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -41,7 +41,7 @@ #include "configparser.h" #include "exitcodes.h" -ServerLimits::ServerLimits(std::shared_ptr<ConfigTag> tag) +ServerLimits::ServerLimits(const std::shared_ptr<ConfigTag>& tag) : MaxLine(tag->getUInt("maxline", 512, 512)) , MaxNick(tag->getUInt("maxnick", 30, 1, MaxLine)) , MaxChannel(tag->getUInt("maxchan", 60, 1, MaxLine)) @@ -56,7 +56,7 @@ ServerLimits::ServerLimits(std::shared_ptr<ConfigTag> tag) { } -ServerConfig::ServerPaths::ServerPaths(std::shared_ptr<ConfigTag> tag) +ServerConfig::ServerPaths::ServerPaths(const std::shared_ptr<ConfigTag>& tag) : Config(tag->getString("configdir", INSPIRCD_CONFIG_PATH, 1)) , Data(tag->getString("datadir", INSPIRCD_DATA_PATH, 1)) , Log(tag->getString("logdir", INSPIRCD_LOG_PATH, 1)) @@ -553,7 +553,7 @@ void ServerConfig::ApplyModules(User* user) } } -std::shared_ptr<ConfigTag> ServerConfig::ConfValue(const std::string& tag, std::shared_ptr<ConfigTag> def) const +const std::shared_ptr<ConfigTag>& ServerConfig::ConfValue(const std::string& tag, const std::shared_ptr<ConfigTag>& def) const { auto tags = insp::equal_range(config_data, tag); if (tags.empty()) |
