summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-01 13:59:31 +0200
committerDavid Robillard <d@drobilla.net>2020-08-02 01:48:48 +0200
commit2539411f2fd0f73b57bd3a8785e10228b32b3c93 (patch)
tree4c991c47e8e16ea914df0681359b2635dfbdd186 /src/gui
parentce23400cbd8cbe8c6a8712ae2ecf88d1053ebc99 (diff)
downloadingen-2539411f2fd0f73b57bd3a8785e10228b32b3c93.tar.gz
ingen-2539411f2fd0f73b57bd3a8785e10228b32b3c93.tar.bz2
ingen-2539411f2fd0f73b57bd3a8785e10228b32b3c93.zip
Fix unnecessary copies in for loops
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/GraphCanvas.cpp4
-rw-r--r--src/gui/LoadGraphWindow.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp
index 391b8729..bd75c352 100644
--- a/src/gui/GraphCanvas.cpp
+++ b/src/gui/GraphCanvas.cpp
@@ -400,7 +400,7 @@ GraphCanvas::get_port_view(const SPtr<PortModel>& port)
} else {
module = dynamic_cast<NodeModule*>(_views[port->parent()]);
if (module) {
- for (const auto& p : *module) {
+ for (auto* p : *module) {
gui::Port* pv = dynamic_cast<gui::Port*>(p);
if (pv && pv->model() == port) {
return pv;
@@ -777,7 +777,7 @@ GraphCanvas::paste()
}
// Connect objects
- for (auto a : clipboard.object(Raul::Path("/"))->arcs()) {
+ for (const auto& a : clipboard.object(Raul::Path("/"))->arcs()) {
_app.interface()->connect(
avoider.map_path(parent.child(a.second->tail_path())),
avoider.map_path(parent.child(a.second->head_path())));
diff --git a/src/gui/LoadGraphWindow.cpp b/src/gui/LoadGraphWindow.cpp
index 62c68b04..cb1d4de9 100644
--- a/src/gui/LoadGraphWindow.cpp
+++ b/src/gui/LoadGraphWindow.cpp
@@ -181,7 +181,7 @@ LoadGraphWindow::ok_clicked()
} else {
std::list<Glib::ustring> uri_list = get_filenames();
- for (auto u : uri_list) {
+ for (const auto& u : uri_list) {
// Cascade
Atom& x = _initial_data.find(uris.ingen_canvasX)->second;
x = _app->forge().make(x.get<float>() + 20.0f);