diff options
author | David Robillard <d@drobilla.net> | 2020-08-01 13:59:31 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-08-02 01:48:48 +0200 |
commit | 2539411f2fd0f73b57bd3a8785e10228b32b3c93 (patch) | |
tree | 4c991c47e8e16ea914df0681359b2635dfbdd186 /src/client | |
parent | ce23400cbd8cbe8c6a8712ae2ecf88d1053ebc99 (diff) | |
download | ingen-2539411f2fd0f73b57bd3a8785e10228b32b3c93.tar.gz ingen-2539411f2fd0f73b57bd3a8785e10228b32b3c93.tar.bz2 ingen-2539411f2fd0f73b57bd3a8785e10228b32b3c93.zip |
Fix unnecessary copies in for loops
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/ClientStore.cpp | 4 | ||||
-rw-r--r-- | src/client/ObjectModel.cpp | 2 | ||||
-rw-r--r-- | src/client/PluginModel.cpp | 2 | ||||
-rw-r--r-- | src/client/PortModel.cpp | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index a42efd16..64489b49 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -84,7 +84,7 @@ ClientStore::add_object(SPtr<ObjectModel> object) } } - for (auto p : object->properties()) { + for (const auto& p : object->properties()) { object->signal_property().emit(p.first, p.second); } } @@ -475,7 +475,7 @@ ClientStore::operator()(const DisconnectAll& msg) } const GraphModel::Arcs arcs = graph->arcs(); - for (auto a : arcs) { + for (const auto& a : arcs) { SPtr<ArcModel> arc = dynamic_ptr_cast<ArcModel>(a.second); if (arc->tail()->parent() == object || arc->head()->parent() == object diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp index b1a27590..78337270 100644 --- a/src/client/ObjectModel.cpp +++ b/src/client/ObjectModel.cpp @@ -88,7 +88,7 @@ ObjectModel::set(const SPtr<ObjectModel>& o) _parent = o->_parent; } - for (auto v : o->properties()) { + for (const auto& v : o->properties()) { Resource::set_property(v.first, v.second); _signal_property.emit(v.first, v.second); } diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp index eaa70b9e..744bdb7d 100644 --- a/src/client/PluginModel.cpp +++ b/src/client/PluginModel.cpp @@ -161,7 +161,7 @@ PluginModel::set(SPtr<PluginModel> p) _lilv_plugin = p->_lilv_plugin; } - for (auto v : p->properties()) { + for (const auto& v : p->properties()) { Resource::set_property(v.first, v.second); _signal_property.emit(v.first, v.second); } diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp index 6b2d011f..fa1a7abe 100644 --- a/src/client/PortModel.cpp +++ b/src/client/PortModel.cpp @@ -55,7 +55,7 @@ bool PortModel::is_uri() const { // FIXME: Resource::has_property doesn't work, URI != URID - for (auto p : properties()) { + for (const auto& p : properties()) { if (p.second.type() == _uris.atom_URID && static_cast<LV2_URID>(p.second.get<int32_t>()) == _uris.atom_URID) { return true; |