From d443ddb053141510311e002c59746a2dd9ba8b16 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 11 Jan 2013 05:40:18 +0000 Subject: Use range-based for loops where possible. Mmm, shiny. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4919 a436a847-0d15-0410-975c-d299462d15a1 --- src/serialisation/Parser.cpp | 12 ++++++------ src/serialisation/Serialiser.cpp | 11 +++++------ 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'src/serialisation') diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp index 5feb8e06..1cea22d6 100644 --- a/src/serialisation/Parser.cpp +++ b/src/serialisation/Parser.cpp @@ -375,9 +375,9 @@ parse_graph(Ingen::World* world, } // Create ports in order by index - for (PortRecords::const_iterator i = ports.begin(); i != ports.end(); ++i) { - target->put(Node::path_to_uri(i->second.first), - i->second.second); + for (const auto& p : ports) { + target->put(Node::path_to_uri(p.second.first), + p.second.second); } parse_arcs(world, target, model, subject_node, graph_path); @@ -528,9 +528,9 @@ parse(Ingen::World* world, } // Parse and create each subject - for (Subjects::const_iterator i = subjects.begin(); i != subjects.end(); ++i) { - const Sord::Node& s = i->first; - const std::set& types = i->second; + for (const auto& i : subjects) { + const Sord::Node& s = i.first; + const std::set& types = i.second; boost::optional ret; const Raul::Path path( relative_uri( model.base_uri().to_string(), s.to_string(), true)); diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp index e371151a..0bd6b49b 100644 --- a/src/serialisation/Serialiser.cpp +++ b/src/serialisation/Serialiser.cpp @@ -413,9 +413,8 @@ Serialiser::Impl::serialise_graph(SharedPtr graph, serialise_port(p, Resource::Graph::INTERNAL, port_id); } - for (Node::Arcs::const_iterator a = graph->arcs().begin(); - a != graph->arcs().end(); ++a) { - serialise_arc(graph_id, a->second); + for (const auto& a : graph->arcs()) { + serialise_arc(graph_id, a.second); } } @@ -544,13 +543,13 @@ Serialiser::Impl::serialise_properties(Sord::Node id, sratom_set_pretty_numbers(_sratom, true); typedef Node::Properties::const_iterator iterator; - for (iterator v = props.begin(); v != props.end(); ++v) { - const Sord::URI key(_model->world(), v->first); + for (const auto& p : props) { + const Sord::URI key(_model->world(), p.first); if (!skip_property(key)) { sratom_write(_sratom, unmap, 0, sord_node_to_serd_node(id.c_obj()), sord_node_to_serd_node(key.c_obj()), - v->second.type(), v->second.size(), v->second.get_body()); + p.second.type(), p.second.size(), p.second.get_body()); } } -- cgit v1.2.1