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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter
2011-02-18 13:19:08 +01:00
parent 7784492234
commit 4ed833abbd
+1 -5
View File
@@ -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;