From 1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 2 Oct 2021 21:27:32 +0100 Subject: Authentication flow: move construction, slim down classes (#5312) - Remove extra members in ForgeHandshake --- src/Server.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Server.cpp') diff --git a/src/Server.cpp b/src/Server.cpp index 8be63c083..08142b008 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -709,7 +709,7 @@ void cServer::KickUser(int a_ClientID, const AString & a_Reason) -void cServer::AuthenticateUser(int a_ClientID, const AString & a_Name, const cUUID & a_UUID, const Json::Value & a_Properties) +void cServer::AuthenticateUser(int a_ClientID, AString && a_Username, const cUUID & a_UUID, Json::Value && a_Properties) { cCSLock Lock(m_CSClients); @@ -720,14 +720,14 @@ void cServer::AuthenticateUser(int a_ClientID, const AString & a_Name, const cUU return; } - for (auto itr = m_Clients.begin(); itr != m_Clients.end(); ++itr) + for (const auto & Client : m_Clients) { - if ((*itr)->GetUniqueID() == a_ClientID) + if (Client->GetUniqueID() == a_ClientID) { - (*itr)->Authenticate(a_Name, a_UUID, a_Properties); + Client->Authenticate(std::move(a_Username), a_UUID, std::move(a_Properties)); return; } - } // for itr - m_Clients[] + } } -- cgit v1.2.3