diff options
author | fynnwilliam <fynnwilliam@gmail.com> | 2022-06-25 23:28:47 -0400 |
---|---|---|
committer | fynnwilliam <fynnwilliam@gmail.com> | 2022-06-25 23:29:33 -0400 |
commit | 0c4d18be3faff0bfc1c8cfbbc26ad4037f3dac12 (patch) | |
tree | cef4ad4821ad3edcfa10ea1da3edf0e5308ba30a /implementation/routing/src/remote_subscription.cpp | |
parent | 98e9062094466a393b122440a323582fecf43b39 (diff) | |
download | vSomeIP-0c4d18be3faff0bfc1c8cfbbc26ad4037f3dac12.tar.gz |
Use reference to prevent copying
Since the variables are marked as const - we are not going to change
them, we may also take them by ref. Which means we just want to see the
variables.
This improves the performance and also helps to generate minimal code.
Diffstat (limited to 'implementation/routing/src/remote_subscription.cpp')
-rw-r--r-- | implementation/routing/src/remote_subscription.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/implementation/routing/src/remote_subscription.cpp b/implementation/routing/src/remote_subscription.cpp index 939e0d1..daec6f9 100644 --- a/implementation/routing/src/remote_subscription.cpp +++ b/implementation/routing/src/remote_subscription.cpp @@ -135,7 +135,7 @@ std::set<client_t> remote_subscription::get_clients() const { std::lock_guard<std::mutex> its_lock(mutex_); std::set<client_t> its_clients; - for (const auto its_item : clients_) + for (const auto& its_item : clients_) its_clients.insert(its_item.first); return its_clients; } |