From 68c778ba1b5f6635eea3420c2dd90ff3b3ecc583 Mon Sep 17 00:00:00 2001 From: heck Date: Thu, 3 Mar 2022 00:57:35 +0100 Subject: [PATCH] CallbackDispatcher: 'auto' does not AUTO declare const'ness or pointer/value semantics (use const&) --- src/callback_dispatcher.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/callback_dispatcher.cc b/src/callback_dispatcher.cc index 7ef702f..3094ef9 100644 --- a/src/callback_dispatcher.cc +++ b/src/callback_dispatcher.cc @@ -59,7 +59,7 @@ namespace pEp { void CallbackDispatcher::on_startup() { - for (auto target : targets) { + for (const auto& target : targets) { if (target.on_startup) { target.on_startup(); } @@ -68,7 +68,7 @@ namespace pEp { void CallbackDispatcher::on_shutdown() { - for (auto target : targets) { + for (const auto& target : targets) { if (target.on_shutdown) { target.on_shutdown(); } @@ -100,7 +100,7 @@ namespace pEp { PassphraseCache::config_next_passphrase(true); } - for (auto target : targets) { + for (const auto& target : targets) { ::message *_msg = nullptr; if (msg) { _msg = ::message_dup(msg); @@ -120,8 +120,8 @@ namespace pEp { ::pEp_identity *partner, ::sync_handshake_signal signal) { - for (auto target : targets) { - if (target.notifyHandshake) { + for (const auto& target : targets) { + if (target.notifyHandshake != nullptr) { ::pEp_identity *_me = nullptr; if (me) { _me = ::identity_dup(me);