mirror of
https://github.com/znc/znc.git
synced 2026-08-08 09:52:55 +02:00
Small optimization for message processing
Avoid creating the map for every message
This commit is contained in:
+1
-1
@@ -378,7 +378,7 @@ bool CIRCSock::OnCapabilityMessage(CMessage& Message) {
|
||||
sArgs = Message.GetParam(2);
|
||||
}
|
||||
|
||||
std::map<CString, std::function<void(bool bVal)>> mSupportedCaps = {
|
||||
static std::map<CString, std::function<void(bool bVal)>> mSupportedCaps = {
|
||||
{"multi-prefix", [this](bool bVal) { m_bNamesx = bVal; }},
|
||||
{"userhost-in-names", [this](bool bVal) { m_bUHNames = bVal; }},
|
||||
{"cap-notify", [](bool bVal) {}},
|
||||
|
||||
+1
-1
@@ -276,7 +276,7 @@ void CMessage::InitType() {
|
||||
m_eType = Type::Notice;
|
||||
}
|
||||
} else {
|
||||
std::map<CString, Type> mTypes = {
|
||||
static std::map<CString, Type> mTypes = {
|
||||
{"ACCOUNT", Type::Account},
|
||||
{"AWAY", Type::Away},
|
||||
{"CAP", Type::Capability},
|
||||
|
||||
Reference in New Issue
Block a user