From 2539411f2fd0f73b57bd3a8785e10228b32b3c93 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 1 Aug 2020 13:59:31 +0200 Subject: Fix unnecessary copies in for loops --- src/gui/GraphCanvas.cpp | 4 ++-- src/gui/LoadGraphWindow.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gui') 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& port) } else { module = dynamic_cast(_views[port->parent()]); if (module) { - for (const auto& p : *module) { + for (auto* p : *module) { gui::Port* pv = dynamic_cast(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 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() + 20.0f); -- cgit v1.2.1