diff options
| author | 2022-12-01 05:39:24 +0000 | |
|---|---|---|
| committer | 2022-12-01 05:39:24 +0000 | |
| commit | d1301063741b3544342e10fcc02f72417000b50e (patch) | |
| tree | 152c8ff0e8f46f4609ba2a4bd0e4804f5fc9a95a /src/users.cpp | |
| parent | Yet more stylistic fixes. (diff) | |
Avoid copying a shared_ptr where not actually necessary.
Diffstat (limited to 'src/users.cpp')
| -rw-r--r-- | src/users.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/users.cpp b/src/users.cpp index fad22e7e3..f700a7659 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -430,8 +430,7 @@ void User::OperLogout() */ void LocalUser::CheckClass(bool clone_count) { - ConnectClass::Ptr a = GetClass(); - + const ConnectClass::Ptr& a = GetClass(); if (!a) { ServerInstance->Users.QuitUser(this, "Access denied by configuration"); @@ -1164,7 +1163,7 @@ ConnectClass::ConnectClass(std::shared_ptr<ConfigTag> tag, Type t, const std::ve { } -ConnectClass::ConnectClass(std::shared_ptr<ConfigTag> tag, Type t, const std::vector<std::string>& masks, ConnectClass::Ptr parent) +ConnectClass::ConnectClass(std::shared_ptr<ConfigTag> tag, Type t, const std::vector<std::string>& masks, const ConnectClass::Ptr& parent) { Update(parent); name = "unnamed"; @@ -1226,7 +1225,7 @@ void ConnectClass::Configure(const std::string& classname, std::shared_ptr<Confi uniqueusername = tag->getBool("uniqueusername", uniqueusername); } -void ConnectClass::Update(const ConnectClass::Ptr src) +void ConnectClass::Update(const ConnectClass::Ptr& src) { ServerInstance->Logs.Debug("CONNECTCLASS", "Updating %s from %s", name.c_str(), src->name.c_str()); commandrate = src->commandrate; |
