summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-25 03:40:39 +0000
committerDavid Robillard <d@drobilla.net>2010-02-25 03:40:39 +0000
commite22984efe9b82ab006494aea93814a592cd44ece (patch)
treea9b1b317515b9fda4947d4fb9c2bc460e07b0c32 /src/gui
parent5d87212114e2df68a086eeb55829a70bed0940d3 (diff)
downloadingen-e22984efe9b82ab006494aea93814a592cd44ece.tar.gz
ingen-e22984efe9b82ab006494aea93814a592cd44ece.tar.bz2
ingen-e22984efe9b82ab006494aea93814a592cd44ece.zip
Store patch connections in a map using a lexicographic <Port*,Port*> key for
fast (logarathmic) connection searching. Replaces all O(num_connections) searches with O(lg(num_connections)) searches. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2491 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/PatchCanvas.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp
index 0762718b..83e921b3 100644
--- a/src/gui/PatchCanvas.cpp
+++ b/src/gui/PatchCanvas.cpp
@@ -272,7 +272,7 @@ PatchCanvas::build()
// Create connections
for (PatchModel::Connections::const_iterator i = _patch->connections().begin();
i != _patch->connections().end(); ++i) {
- connection(PtrCast<ConnectionModel>(*i));
+ connection(PtrCast<ConnectionModel>(i->second));
}
}
@@ -708,7 +708,7 @@ PatchCanvas::paste()
assert(root);
for (Patch::Connections::const_iterator i = root->connections().begin();
i != root->connections().end(); ++i) {
- App::instance().engine()->connect((*i)->src_port_path(), (*i)->dst_port_path());
+ App::instance().engine()->connect(i->second->src_port_path(), i->second->dst_port_path());
}
}