summaryrefslogtreecommitdiffstats
path: root/src/server/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2017-03-19 10:36:11 +0100
committerDavid Robillard <d@drobilla.net>2017-03-20 02:58:56 +0100
commitefc0fe0a973db706d9409b345ad6fae585f4388c (patch)
tree6348b6bd17e358ed328b5c443966436fb36521e5 /src/server/events
parentf46a3ec40a691a6892ad5536ca47de175a9c05b7 (diff)
downloadingen-efc0fe0a973db706d9409b345ad6fae585f4388c.tar.gz
ingen-efc0fe0a973db706d9409b345ad6fae585f4388c.tar.bz2
ingen-efc0fe0a973db706d9409b345ad6fae585f4388c.zip
Improve arc list efficiency
Diffstat (limited to 'src/server/events')
-rw-r--r--src/server/events/Connect.cpp2
-rw-r--r--src/server/events/Disconnect.cpp9
2 files changed, 6 insertions, 5 deletions
diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp
index e02b19a8..c75e56a1 100644
--- a/src/server/events/Connect.cpp
+++ b/src/server/events/Connect.cpp
@@ -153,7 +153,7 @@ void
Connect::execute(RunContext& context)
{
if (_status == Status::SUCCESS) {
- _head->add_arc(context, _arc.get());
+ _head->add_arc(context, *_arc.get());
if (!_head->is_driver_port()) {
_head->set_voices(context, std::move(_voices));
}
diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp
index 9320163a..176f0999 100644
--- a/src/server/events/Disconnect.cpp
+++ b/src/server/events/Disconnect.cpp
@@ -170,11 +170,12 @@ Disconnect::pre_process(PreProcessContext& ctx)
bool
Disconnect::Impl::execute(RunContext& context, bool set_head_buffers)
{
- ArcImpl* const port_arc = _head->remove_arc(context, _tail);
-
- if (!port_arc) {
+ if (!_arc) {
return false;
- } else if (_head->is_driver_port()) {
+ }
+
+ _head->remove_arc(*_arc.get());
+ if (_head->is_driver_port()) {
return true;
}