From 37729e5b314e39fb750a3fb46a005acdb15b4ac2 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 25 Dec 2017 16:37:00 -0500 Subject: Use auto for iterators --- src/client/BlockModel.cpp | 4 ++-- src/client/ClientStore.cpp | 6 +++--- src/client/GraphModel.cpp | 8 ++++---- src/client/ObjectModel.cpp | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/client') diff --git a/src/client/BlockModel.cpp b/src/client/BlockModel.cpp index 95819c1e..cf778408 100644 --- a/src/client/BlockModel.cpp +++ b/src/client/BlockModel.cpp @@ -67,7 +67,7 @@ BlockModel::~BlockModel() void BlockModel::remove_port(SPtr port) { - for (Ports::iterator i = _ports.begin(); i != _ports.end(); ++i) { + for (auto i = _ports.begin(); i != _ports.end(); ++i) { if ((*i) == port) { _ports.erase(i); break; @@ -79,7 +79,7 @@ BlockModel::remove_port(SPtr port) void BlockModel::remove_port(const Raul::Path& port_path) { - for (Ports::iterator i = _ports.begin(); i != _ports.end(); ++i) { + for (auto i = _ports.begin(); i != _ports.end(); ++i) { if ((*i)->path() == port_path) { _ports.erase(i); break; diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 123b9050..356a6b31 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -55,7 +55,7 @@ ClientStore::add_object(SPtr object) { // If we already have "this" object, merge the existing one into the new // one (with precedence to the new values). - iterator existing = find(object->path()); + auto existing = find(object->path()); if (existing != end()) { dynamic_ptr_cast(existing->second)->set(object); } else { @@ -202,7 +202,7 @@ ClientStore::operator()(const Del& del) if (uri_is_path(del.uri)) { remove_object(uri_to_path(del.uri)); } else { - Plugins::iterator p = _plugins->find(del.uri); + auto p = _plugins->find(del.uri); if (p != _plugins->end()) { _plugins->erase(p); _signal_plugin_deleted.emit(del.uri); @@ -296,7 +296,7 @@ ClientStore::operator()(const Put& msg) model->set_properties(properties); add_object(model); } else if (is_block) { - Iterator p = properties.find(_uris.lv2_prototype); + auto p = properties.find(_uris.lv2_prototype); if (p == properties.end()) { p = properties.find(_uris.ingen_prototype); } diff --git a/src/client/GraphModel.cpp b/src/client/GraphModel.cpp index 762ed8ed..b5838d19 100644 --- a/src/client/GraphModel.cpp +++ b/src/client/GraphModel.cpp @@ -67,8 +67,8 @@ GraphModel::remove_arcs_on(SPtr p) { // Remove any connections which referred to this object, // since they can't possibly exist anymore - for (Arcs::iterator j = _arcs.begin(); j != _arcs.end();) { - Arcs::iterator next = j; + for (auto j = _arcs.begin(); j != _arcs.end();) { + auto next = j; ++next; SPtr arc = dynamic_ptr_cast(j->second); @@ -97,7 +97,7 @@ GraphModel::clear() SPtr GraphModel::get_arc(const Node* tail, const Node* head) { - Arcs::iterator i = _arcs.find(std::make_pair(tail, head)); + auto i = _arcs.find(std::make_pair(tail, head)); if (i != _arcs.end()) { return dynamic_ptr_cast(i->second); } else { @@ -144,7 +144,7 @@ GraphModel::add_arc(SPtr arc) void GraphModel::remove_arc(const Node* tail, const Node* head) { - Arcs::iterator i = _arcs.find(std::make_pair(tail, head)); + auto i = _arcs.find(std::make_pair(tail, head)); if (i != _arcs.end()) { SPtr arc = dynamic_ptr_cast(i->second); _signal_removed_arc.emit(arc); diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp index 5aee03ce..45136546 100644 --- a/src/client/ObjectModel.cpp +++ b/src/client/ObjectModel.cpp @@ -58,7 +58,7 @@ const Atom& ObjectModel::get_property(const Raul::URI& key) const { static const Atom null_atom; - Properties::const_iterator i = properties().find(key); + auto i = properties().find(key); return (i != properties().end()) ? i->second : null_atom; } -- cgit v1.2.1