summaryrefslogtreecommitdiff
path: root/include/tgbot/EventBroadcaster.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/tgbot/EventBroadcaster.h')
-rw-r--r--include/tgbot/EventBroadcaster.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/tgbot/EventBroadcaster.h b/include/tgbot/EventBroadcaster.h
index 38d5be6..978a6fe 100644
--- a/include/tgbot/EventBroadcaster.h
+++ b/include/tgbot/EventBroadcaster.h
@@ -107,12 +107,12 @@ private:
}
}
- inline void broadcastAnyMessage(const Message::Ptr message) const {
+ inline void broadcastAnyMessage(const Message::Ptr& message) const {
broadcast<MessageListener, Message::Ptr>(_onAnyMessageListeners, message);
}
- inline bool broadcastCommand(const std::string command, const Message::Ptr message) const {
- std::unordered_map<std::string, MessageListener>::const_iterator iter = _onCommandListeners.find(command);
+ inline bool broadcastCommand(const std::string& command, const Message::Ptr& message) const {
+ auto iter = _onCommandListeners.find(command);
if (iter == _onCommandListeners.end()) {
return false;
}
@@ -120,23 +120,23 @@ private:
return true;
}
- inline void broadcastUnknownCommand(const Message::Ptr message) const {
+ inline void broadcastUnknownCommand(const Message::Ptr& message) const {
broadcast<MessageListener, Message::Ptr>(_onUnknownCommandListeners, message);
}
- inline void broadcastNonCommandMessage(const Message::Ptr message) const {
+ inline void broadcastNonCommandMessage(const Message::Ptr& message) const {
broadcast<MessageListener, Message::Ptr>(_onNonCommandMessageListeners, message);
}
- inline void broadcastInlineQuery(const InlineQuery::Ptr query) const {
+ inline void broadcastInlineQuery(const InlineQuery::Ptr& query) const {
broadcast<InlineQueryListener, InlineQuery::Ptr>(_onInlineQueryListeners, query);
}
- inline void broadcastChosenInlineResult(const ChosenInlineResult::Ptr result) const {
+ inline void broadcastChosenInlineResult(const ChosenInlineResult::Ptr& result) const {
broadcast<ChosenInlineResultListener, ChosenInlineResult::Ptr>(_onChosenInlineResultListeners, result);
}
- inline void broadcastCallbackQuery(const CallbackQuery::Ptr result) const {
+ inline void broadcastCallbackQuery(const CallbackQuery::Ptr& result) const {
broadcast<CallbackQueryListener, CallbackQuery::Ptr>(_onCallbackQueryListeners, result);
}