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
This commit is contained in:
psychon
2010-06-16 19:11:07 +00:00
parent e00fa2176e
commit e5ecd9c944
+2 -2
View File
@@ -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).