diff options
author | David Robillard <d@drobilla.net> | 2017-03-19 10:36:11 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-03-20 02:58:56 +0100 |
commit | efc0fe0a973db706d9409b345ad6fae585f4388c (patch) | |
tree | 6348b6bd17e358ed328b5c443966436fb36521e5 /src/server/InputPort.cpp | |
parent | f46a3ec40a691a6892ad5536ca47de175a9c05b7 (diff) | |
download | ingen-efc0fe0a973db706d9409b345ad6fae585f4388c.tar.gz ingen-efc0fe0a973db706d9409b345ad6fae585f4388c.tar.bz2 ingen-efc0fe0a973db706d9409b345ad6fae585f4388c.zip |
Improve arc list efficiency
Diffstat (limited to 'src/server/InputPort.cpp')
-rw-r--r-- | src/server/InputPort.cpp | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp index b0e2ee61..63a752b1 100644 --- a/src/server/InputPort.cpp +++ b/src/server/InputPort.cpp @@ -125,29 +125,15 @@ InputPort::setup_buffers(RunContext& ctx, BufferFactory& bufs, uint32_t poly) } void -InputPort::add_arc(RunContext& context, ArcImpl* c) +InputPort::add_arc(RunContext& context, ArcImpl& c) { - _arcs.push_front(*c); + _arcs.push_front(c); } -ArcImpl* -InputPort::remove_arc(RunContext& context, const PortImpl* tail) +void +InputPort::remove_arc(ArcImpl& arc) { - ArcImpl* arc = NULL; - for (Arcs::iterator i = _arcs.begin(); i != _arcs.end(); ++i) { - if (i->tail() == tail) { - arc = &*i; - _arcs.erase(i); - break; - } - } - - if (!arc) { - context.engine().log().rt_error("Attempt to remove non-existent arc\n"); - return NULL; - } - - return arc; + _arcs.erase(_arcs.iterator_to(arc)); } uint32_t |