summaryrefslogtreecommitdiffstats
path: root/src/server/events/CreatePort.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-08-18 00:04:37 -0400
committerDavid Robillard <d@drobilla.net>2022-08-18 01:12:58 -0400
commit1bf1ab5c898f6e6d6e878a716540d0049f5cb206 (patch)
treec57017ccfd1598e872ede9459a70b396501d7b76 /src/server/events/CreatePort.cpp
parent6bce9e50915d730caa3bd2b60c513fe9915e4b83 (diff)
downloadingen-1bf1ab5c898f6e6d6e878a716540d0049f5cb206.tar.gz
ingen-1bf1ab5c898f6e6d6e878a716540d0049f5cb206.tar.bz2
ingen-1bf1ab5c898f6e6d6e878a716540d0049f5cb206.zip
Use auto when declaring iterators
Diffstat (limited to 'src/server/events/CreatePort.cpp')
-rw-r--r--src/server/events/CreatePort.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/server/events/CreatePort.cpp b/src/server/events/CreatePort.cpp
index 1fa2a528..ba2c9a9a 100644
--- a/src/server/events/CreatePort.cpp
+++ b/src/server/events/CreatePort.cpp
@@ -66,11 +66,8 @@ CreatePort::CreatePort(Engine& engine,
{
const ingen::URIs& uris = _engine.world().uris();
- using Iterator = Properties::const_iterator;
- using Range = std::pair<Iterator, Iterator>;
-
- const Range types = properties.equal_range(uris.rdf_type);
- for (Iterator i = types.first; i != types.second; ++i) {
+ const auto types = properties.equal_range(uris.rdf_type);
+ for (auto i = types.first; i != types.second; ++i) {
const Atom& type = i->second;
if (type == uris.lv2_AudioPort) {
_port_type = PortType::AUDIO;
@@ -87,8 +84,8 @@ CreatePort::CreatePort(Engine& engine,
}
}
- const Range buffer_types = properties.equal_range(uris.atom_bufferType);
- for (Iterator i = buffer_types.first; i != buffer_types.second; ++i) {
+ const auto buffer_types = properties.equal_range(uris.atom_bufferType);
+ for (auto i = buffer_types.first; i != buffer_types.second; ++i) {
if (uris.forge.is_uri(i->second)) {
_buf_type = _engine.world().uri_map().map_uri(
uris.forge.str(i->second, false));
@@ -123,10 +120,8 @@ CreatePort::pre_process(PreProcessContext&)
const uint32_t buf_size = bufs.default_size(_buf_type);
const int32_t old_n_ports = _graph->num_ports_non_rt();
- using PropIter = Properties::const_iterator;
-
- PropIter index_i = _properties.find(uris.lv2_index);
- int32_t index = 0;
+ auto index_i = _properties.find(uris.lv2_index);
+ int32_t index = 0;
if (index_i != _properties.end()) {
// Ensure given index is sane and not taken
if (index_i->second.type() != uris.forge.Int) {
@@ -144,7 +139,7 @@ CreatePort::pre_process(PreProcessContext&)
_engine.world().forge().make(index));
}
- const PropIter poly_i = _properties.find(uris.ingen_polyphonic);
+ const auto poly_i = _properties.find(uris.ingen_polyphonic);
const bool polyphonic = (poly_i != _properties.end() &&
poly_i->second.type() == uris.forge.Bool &&
poly_i->second.get<int32_t>());