summaryrefslogtreecommitdiff
path: root/include/tgbot/EventBroadcaster.h
diff options
context:
space:
mode:
authorEgor Pugin <egor.pugin@gmail.com>2020-03-14 17:34:07 +0300
committerGitHub <noreply@github.com>2020-03-14 17:34:07 +0300
commitb3e84e58d471412b9d26e173b77c757d93d57b19 (patch)
tree5ad991beda3975e8d8237562724e20f30d169d40 /include/tgbot/EventBroadcaster.h
parent9afa9c4e97faa9a6d7e6089ec1f822047738fdec (diff)
parent64174491dac84c559db5c48ed850177fa3eb4da0 (diff)
Merge pull request #133 from JellyBrick/master
Fix #127, #128 & Code quality improvements
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);
}