From 6436ce26daefba37c7a612591a33b18365db69b7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 1 Aug 2020 16:05:03 +0200 Subject: Pass by value and use std::move --- ingen/FilePath.hpp | 3 +-- ingen/Resource.hpp | 4 ++-- ingen/client/BlockModel.hpp | 4 +--- ingen/client/GraphModel.hpp | 7 +++++-- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'ingen') diff --git a/ingen/FilePath.hpp b/ingen/FilePath.hpp index 98893dfc..337553ef 100644 --- a/ingen/FilePath.hpp +++ b/ingen/FilePath.hpp @@ -54,8 +54,7 @@ public: FilePath(const FilePath&) = default; FilePath(FilePath&&) = default; - FilePath(string_type&& str) : _str(std::move(str)) {} - FilePath(const string_type& str) : _str(str) {} + FilePath(string_type str) : _str(std::move(str)) {} FilePath(const value_type* str) : _str(str) {} FilePath(const boost::basic_string_view& sv) : _str(sv.data(), sv.length()) diff --git a/ingen/Resource.hpp b/ingen/Resource.hpp index cc1f5db0..481e4c30 100644 --- a/ingen/Resource.hpp +++ b/ingen/Resource.hpp @@ -41,9 +41,9 @@ class INGEN_API Resource : public Raul::Deletable public: using Graph = Property::Graph; - Resource(const URIs& uris, const URI& uri) + Resource(const URIs& uris, URI uri) : _uris(uris) - , _uri(uri) + , _uri(std::move(uri)) {} Resource(const Resource& resource) = default; diff --git a/ingen/client/BlockModel.hpp b/ingen/client/BlockModel.hpp index 511e5712..d003b7d1 100644 --- a/ingen/client/BlockModel.hpp +++ b/ingen/client/BlockModel.hpp @@ -84,9 +84,7 @@ public: protected: friend class ClientStore; - BlockModel(URIs& uris, - const URI& plugin_uri, - const Raul::Path& path); + BlockModel(URIs& uris, URI plugin_uri, const Raul::Path& path); BlockModel(URIs& uris, const SPtr& plugin, diff --git a/ingen/client/GraphModel.hpp b/ingen/client/GraphModel.hpp index c11c419e..2248e7e3 100644 --- a/ingen/client/GraphModel.hpp +++ b/ingen/client/GraphModel.hpp @@ -60,8 +60,11 @@ private: friend class ClientStore; GraphModel(URIs& uris, const Raul::Path& graph_path) - : BlockModel(uris, uris.ingen_Graph, graph_path) - {} + : BlockModel(uris, + static_cast(uris.ingen_Graph), + graph_path) + { + } void clear() override; void add_child(const SPtr& c) override; -- cgit v1.2.1