From 7d9b2ee5ae8db92f4e28296983d706593197239a Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 15 Jun 2021 10:47:58 +0200 Subject: Avoid a few copies in loops --- src/MuxElements.cpp | 2 +- src/utils.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/MuxElements.cpp b/src/MuxElements.cpp index 1d95cc0..71ff270 100644 --- a/src/MuxElements.cpp +++ b/src/MuxElements.cpp @@ -422,7 +422,7 @@ vec_sp_service::iterator getService( vec_sp_service& services) { size_t i = 0; - for (const auto service : services) { + for (const auto& service : services) { if (service->id == component->serviceId) { return services.begin() + i; } diff --git a/src/utils.cpp b/src/utils.cpp index ae56ef0..71e2b5c 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -548,7 +548,7 @@ void printEnsemble(const shared_ptr& ensemble) printServices(ensemble->services); etiLog.log(info, "--- Components list ---"); - for (const auto component : ensemble->components) { + for (const auto& component : ensemble->components) { etiLog.level(info) << "Component " << component->get_rc_name(); printComponent(component, ensemble); } -- cgit v1.2.3