diff options
author | David Robillard <d@drobilla.net> | 2019-12-08 17:24:03 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-12-08 20:59:06 +0100 |
commit | 8215246d12f49573f7ebcdc62ddae84185c22bfe (patch) | |
tree | 6aca9dfb5153a962302dcf980405570ad28f445a /src/server | |
parent | ecad88d2128f920f5e11cc3ff443d62b225c79d3 (diff) | |
download | ingen-8215246d12f49573f7ebcdc62ddae84185c22bfe.tar.gz ingen-8215246d12f49573f7ebcdc62ddae84185c22bfe.tar.bz2 ingen-8215246d12f49573f7ebcdc62ddae84185c22bfe.zip |
Cleanup: Use range-based for loops
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/GraphImpl.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/server/GraphImpl.cpp b/src/server/GraphImpl.cpp index 05bc6e4a..c00819c2 100644 --- a/src/server/GraphImpl.cpp +++ b/src/server/GraphImpl.cpp @@ -87,17 +87,17 @@ GraphImpl::duplicate(Engine& engine, // Add duplicates of all ports dup->_ports = bufs.maid().make_managed<Ports>(num_ports(), nullptr); - for (PortList::iterator p = _inputs.begin(); p != _inputs.end(); ++p) { - DuplexPort* p_dup = p->duplicate(engine, p->symbol(), dup); + for (auto& p : _inputs) { + DuplexPort* p_dup = p.duplicate(engine, p.symbol(), dup); dup->_inputs.push_front(*p_dup); - (*dup->_ports)[p->index()] = p_dup; - port_map.insert({&*p, p_dup}); + (*dup->_ports)[p.index()] = p_dup; + port_map.insert({&p, p_dup}); } - for (PortList::iterator p = _outputs.begin(); p != _outputs.end(); ++p) { - DuplexPort* p_dup = p->duplicate(engine, p->symbol(), dup); + for (auto& p : _outputs) { + DuplexPort* p_dup = p.duplicate(engine, p.symbol(), dup); dup->_outputs.push_front(*p_dup); - (*dup->_ports)[p->index()] = p_dup; - port_map.insert({&*p, p_dup}); + (*dup->_ports)[p.index()] = p_dup; + port_map.insert({&p, p_dup}); } // Add duplicates of all blocks @@ -321,14 +321,14 @@ GraphImpl::has_port_with_index(uint32_t index) const BufferFactory& bufs = *_engine.buffer_factory(); const auto index_atom = bufs.forge().make(int32_t(index)); - for (auto p = _inputs.begin(); p != _inputs.end(); ++p) { - if (p->has_property(bufs.uris().lv2_index, index_atom)) { + for (const auto& p : _inputs) { + if (p.has_property(bufs.uris().lv2_index, index_atom)) { return true; } } - for (auto p = _outputs.begin(); p != _outputs.end(); ++p) { - if (p->has_property(bufs.uris().lv2_index, index_atom)) { + for (const auto& p : _outputs) { + if (p.has_property(bufs.uris().lv2_index, index_atom)) { return true; } } @@ -362,11 +362,11 @@ GraphImpl::build_ports_array(Raul::Maid& maid) MPtr<Ports> result = maid.make_managed<Ports>(n); std::map<size_t, DuplexPort*> ports; - for (PortList::iterator p = _inputs.begin(); p != _inputs.end(); ++p) { - ports.emplace(p->index(), &*p); + for (auto& p : _inputs) { + ports.emplace(p.index(), &p); } - for (PortList::iterator p = _outputs.begin(); p != _outputs.end(); ++p) { - ports.emplace(p->index(), &*p); + for (auto& p : _outputs) { + ports.emplace(p.index(), &p); } size_t i = 0; |