diff options
author | David Robillard <d@drobilla.net> | 2013-01-11 05:40:18 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2013-01-11 05:40:18 +0000 |
commit | d443ddb053141510311e002c59746a2dd9ba8b16 (patch) | |
tree | 6bbe7b6532824117dc9a1ca25d7a09ef3601c2cc /src/serialisation | |
parent | 10e9a3a800a35916872abf9e354be4c554338e4e (diff) | |
download | ingen-d443ddb053141510311e002c59746a2dd9ba8b16.tar.gz ingen-d443ddb053141510311e002c59746a2dd9ba8b16.tar.bz2 ingen-d443ddb053141510311e002c59746a2dd9ba8b16.zip |
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
Diffstat (limited to 'src/serialisation')
-rw-r--r-- | src/serialisation/Parser.cpp | 12 | ||||
-rw-r--r-- | src/serialisation/Serialiser.cpp | 11 |
2 files changed, 11 insertions, 12 deletions
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<Sord::Node>& types = i->second; + for (const auto& i : subjects) { + const Sord::Node& s = i.first; + const std::set<Sord::Node>& types = i.second; boost::optional<Raul::Path> 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<const Node> 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()); } } |