diff options
| author | 2023-01-10 20:57:56 +0000 | |
|---|---|---|
| committer | 2023-01-10 21:27:18 +0000 | |
| commit | 1b2916c8451506adccf3ab0a56bbf836d9f3cb36 (patch) | |
| tree | 8675a6bf6fdf97b0f7dba5449fe59f1f669986a2 /src/modules/m_hostchange.cpp | |
| parent | Fix calling the base Set/Unset implementation in ListExtItem. (diff) | |
Avoid copying shared_ptr<ConfigTag> when not necessary.
Diffstat (limited to 'src/modules/m_hostchange.cpp')
| -rw-r--r-- | src/modules/m_hostchange.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp index a24f94d9b..4f656f04a 100644 --- a/src/modules/m_hostchange.cpp +++ b/src/modules/m_hostchange.cpp @@ -51,7 +51,7 @@ private: std::string prefix; std::string suffix; - void ReadConfig(std::shared_ptr<ConfigTag> tag) + void ReadConfig(const std::shared_ptr<ConfigTag>& tag) { // Parse <hostchange:class>. klass = tag->getString("class"); @@ -70,7 +70,7 @@ private: } public: - HostRule(std::shared_ptr<ConfigTag> tag, const std::string& Mask, const std::string& Host) + HostRule(const std::shared_ptr<ConfigTag>& tag, const std::string& Mask, const std::string& Host) : action(HCA_SET) , host(Host) , mask(Mask) @@ -78,7 +78,7 @@ public: ReadConfig(tag); } - HostRule(std::shared_ptr<ConfigTag> tag, HostChangeAction Action, const std::string& Mask, const std::string& Prefix, const std::string& Suffix) + HostRule(const std::shared_ptr<ConfigTag>& tag, HostChangeAction Action, const std::string& Mask, const std::string& Prefix, const std::string& Suffix) : action(Action) , mask(Mask) , prefix(Prefix) @@ -192,7 +192,7 @@ public: } } - auto tag = ServerInstance->Config->ConfValue("hostname"); + const auto& tag = ServerInstance->Config->ConfValue("hostname"); const std::string hmap = tag->getString("charmap", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.-_/0123456789", 1); CharState newhostmap; |
