From 4ed833abbd73773a4cb0a5c825d6056edf7562f8 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 18 Feb 2011 13:19:08 +0100 Subject: [PATCH] Remove a useless lookup All the places that add entries to the CTCPReplies map use CString::Token(0) to split the first token away. This means it is impossible for this to contain spaces. Now this means that it is pointless to look up the full CTCP request in the CTCPReplies map because it can't contain any matching item. Signed-off-by: Uli Schlachter --- IRCSock.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/IRCSock.cpp b/IRCSock.cpp index 871e5071..0e0237fe 100644 --- a/IRCSock.cpp +++ b/IRCSock.cpp @@ -822,15 +822,11 @@ bool CIRCSock::OnPrivCTCP(CNick& Nick, CString& sMessage) { bool CIRCSock::OnGeneralCTCP(CNick& Nick, CString& sMessage) { const MCString& mssCTCPReplies = m_pUser->GetCTCPReplies(); - MCString::const_iterator it = mssCTCPReplies.find(sMessage.AsUpper()); CString sQuery = sMessage.Token(0).AsUpper(); + MCString::const_iterator it = mssCTCPReplies.find(sQuery); bool bHaveReply = false; CString sReply; - if (it == mssCTCPReplies.end()) { - it = mssCTCPReplies.find(sQuery); - } - if (it != mssCTCPReplies.end()) { sReply = m_pUser->ExpandString(it->second); bHaveReply = true;