diff options
author | David Robillard <d@drobilla.net> | 2020-12-14 21:25:19 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-12-14 22:04:29 +0100 |
commit | 3669e06dd20d43d30bf89ac29e9055e0725b3564 (patch) | |
tree | 6086002971126dba88aa762aa1d487069395a137 /src/gui/WindowFactory.cpp | |
parent | 6d82745afdeff69ace846e0c10bf95b3362e1c03 (diff) | |
download | ingen-3669e06dd20d43d30bf89ac29e9055e0725b3564.tar.gz ingen-3669e06dd20d43d30bf89ac29e9055e0725b3564.tar.bz2 ingen-3669e06dd20d43d30bf89ac29e9055e0725b3564.zip |
Fix unnecessary parameter copying overhead
Diffstat (limited to 'src/gui/WindowFactory.cpp')
-rw-r--r-- | src/gui/WindowFactory.cpp | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp index a394f3f5..80f61235 100644 --- a/src/gui/WindowFactory.cpp +++ b/src/gui/WindowFactory.cpp @@ -101,7 +101,7 @@ WindowFactory::num_open_graph_windows() } GraphBox* -WindowFactory::graph_box(std::shared_ptr<const GraphModel> graph) +WindowFactory::graph_box(const std::shared_ptr<const GraphModel>& graph) { GraphWindow* window = graph_window(graph); if (window) { @@ -112,7 +112,7 @@ WindowFactory::graph_box(std::shared_ptr<const GraphModel> graph) } GraphWindow* -WindowFactory::graph_window(std::shared_ptr<const GraphModel> graph) +WindowFactory::graph_window(const std::shared_ptr<const GraphModel>& graph) { if (!graph) { return nullptr; @@ -124,7 +124,8 @@ WindowFactory::graph_window(std::shared_ptr<const GraphModel> graph) } GraphWindow* -WindowFactory::parent_graph_window(std::shared_ptr<const BlockModel> block) +WindowFactory::parent_graph_window( + const std::shared_ptr<const BlockModel>& block) { if (!block) { return nullptr; @@ -140,9 +141,9 @@ WindowFactory::parent_graph_window(std::shared_ptr<const BlockModel> block) * presented and `preferred` left unmodified. */ void -WindowFactory::present_graph(std::shared_ptr<const GraphModel> graph, - GraphWindow* preferred, - std::shared_ptr<GraphView> view) +WindowFactory::present_graph(const std::shared_ptr<const GraphModel>& graph, + GraphWindow* preferred, + const std::shared_ptr<GraphView>& view) { assert(!view || view->graph() == graph); @@ -166,8 +167,8 @@ WindowFactory::present_graph(std::shared_ptr<const GraphModel> graph, } GraphWindow* -WindowFactory::new_graph_window(std::shared_ptr<const GraphModel> graph, - std::shared_ptr<GraphView> view) +WindowFactory::new_graph_window(const std::shared_ptr<const GraphModel>& graph, + const std::shared_ptr<GraphView>& view) { assert(!view || view->graph() == graph); @@ -208,8 +209,9 @@ WindowFactory::remove_graph_window(GraphWindow* win, GdkEventAny* ignored) } void -WindowFactory::present_load_plugin(std::shared_ptr<const GraphModel> graph, - Properties data) +WindowFactory::present_load_plugin( + const std::shared_ptr<const GraphModel>& graph, + const Properties& data) { _app.request_plugins_if_necessary(); @@ -233,8 +235,9 @@ WindowFactory::present_load_plugin(std::shared_ptr<const GraphModel> graph, } void -WindowFactory::present_load_graph(std::shared_ptr<const GraphModel> graph, - Properties data) +WindowFactory::present_load_graph( + const std::shared_ptr<const GraphModel>& graph, + const Properties& data) { auto w = _graph_windows.find(graph->path()); @@ -246,8 +249,9 @@ WindowFactory::present_load_graph(std::shared_ptr<const GraphModel> graph, } void -WindowFactory::present_load_subgraph(std::shared_ptr<const GraphModel> graph, - Properties data) +WindowFactory::present_load_subgraph( + const std::shared_ptr<const GraphModel>& graph, + const Properties& data) { auto w = _graph_windows.find(graph->path()); @@ -259,8 +263,9 @@ WindowFactory::present_load_subgraph(std::shared_ptr<const GraphModel> graph, } void -WindowFactory::present_new_subgraph(std::shared_ptr<const GraphModel> graph, - Properties data) +WindowFactory::present_new_subgraph( + const std::shared_ptr<const GraphModel>& graph, + const Properties& data) { auto w = _graph_windows.find(graph->path()); @@ -272,7 +277,7 @@ WindowFactory::present_new_subgraph(std::shared_ptr<const GraphModel> graph, } void -WindowFactory::present_rename(std::shared_ptr<const ObjectModel> object) +WindowFactory::present_rename(const std::shared_ptr<const ObjectModel>& object) { auto w = _graph_windows.find(object->path()); if (w == _graph_windows.end()) { @@ -287,7 +292,8 @@ WindowFactory::present_rename(std::shared_ptr<const ObjectModel> object) } void -WindowFactory::present_properties(std::shared_ptr<const ObjectModel> object) +WindowFactory::present_properties( + const std::shared_ptr<const ObjectModel>& object) { auto w = _graph_windows.find(object->path()); if (w == _graph_windows.end()) { |