mirror of
https://github.com/znc/znc.git
synced 2026-07-05 01:11:53 +02:00
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:
+1
-5
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user