From 237684cfd042917a26274872c4ffe1e3cdd5c3a8 Mon Sep 17 00:00:00 2001 From: JellyBrick Date: Fri, 8 Jun 2018 15:26:25 +0900 Subject: Performance optimization --- include/tgbot/EventBroadcaster.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/tgbot/EventBroadcaster.h') diff --git a/include/tgbot/EventBroadcaster.h b/include/tgbot/EventBroadcaster.h index 5a41c70..0a4ebe9 100644 --- a/include/tgbot/EventBroadcaster.h +++ b/include/tgbot/EventBroadcaster.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include "tgbot/types/Message.h" #include "tgbot/types/InlineQuery.h" @@ -133,7 +133,7 @@ private: } inline bool broadcastCommand(const std::string command, const Message::Ptr message) const { - std::map::const_iterator iter = _onCommandListeners.find(command); + std::unordered_map::const_iterator iter = _onCommandListeners.find(command); if (iter == _onCommandListeners.end()) { return false; } @@ -162,7 +162,7 @@ private: } std::vector _onAnyMessageListeners; - std::map _onCommandListeners; + std::unordered_map _onCommandListeners; std::vector _onUnknownCommandListeners; std::vector _onNonCommandMessageListeners; std::vector _onInlineQueryListeners; -- cgit v1.2.3