From e5ecd9c944d7f75e3f8ac50e200c9e72720bbe8b Mon Sep 17 00:00:00 2001 From: psychon Date: Wed, 16 Jun 2010 19:11:07 +0000 Subject: [PATCH] Micro optimization Only call GetUser() when we actually need the result git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2028 726aef4b-f618-498e-8847-2d620e286838 --- Client.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Client.cpp b/Client.cpp index 3641d830..02a0b096 100644 --- a/Client.cpp +++ b/Client.cpp @@ -631,11 +631,11 @@ void CAuthBase::AcceptLogin(CUser& User) { } void CAuthBase::RefuseLogin(const CString& sReason) { - CUser* pUser = CZNC::Get().GetUser(GetUsername()); - if (!m_pSock) return; + CUser* pUser = CZNC::Get().GetUser(GetUsername()); + // If the username is valid, notify that user that someone tried to // login. Use sReason because there are other reasons than "wrong // password" for a login to be rejected (e.g. fail2ban).