summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-01 16:05:03 +0200
committerDavid Robillard <d@drobilla.net>2020-08-02 01:48:48 +0200
commit6436ce26daefba37c7a612591a33b18365db69b7 (patch)
tree88da992e3de43c90ee98f8df73a7af21cd77d26f
parent0aea3dae1101e6f21f4ab51fd3301d2786b7f5c4 (diff)
downloadingen-6436ce26daefba37c7a612591a33b18365db69b7.tar.gz
ingen-6436ce26daefba37c7a612591a33b18365db69b7.tar.bz2
ingen-6436ce26daefba37c7a612591a33b18365db69b7.zip
Pass by value and use std::move
-rw-r--r--.clang-tidy1
-rw-r--r--ingen/FilePath.hpp3
-rw-r--r--ingen/Resource.hpp4
-rw-r--r--ingen/client/BlockModel.hpp4
-rw-r--r--ingen/client/GraphModel.hpp7
-rw-r--r--src/client/BlockModel.cpp14
6 files changed, 15 insertions, 18 deletions
diff --git a/.clang-tidy b/.clang-tidy
index 859cb534..1722ecfb 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -55,7 +55,6 @@ Checks: >
-llvm-namespace-comment,
-misc-unused-parameters,
-modernize-make-shared,
- -modernize-pass-by-value,
-modernize-redundant-void-arg,
-modernize-use-default-member-init,
-modernize-use-trailing-return-type,
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<value_type>& 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<PluginModel>& 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<const URI&>(uris.ingen_Graph),
+ graph_path)
+ {
+ }
void clear() override;
void add_child(const SPtr<ObjectModel>& c) override;
diff --git a/src/client/BlockModel.cpp b/src/client/BlockModel.cpp
index a3018939..3d68d8da 100644
--- a/src/client/BlockModel.cpp
+++ b/src/client/BlockModel.cpp
@@ -41,14 +41,12 @@ BlockModel::BlockModel(URIs& uris,
{
}
-BlockModel::BlockModel(URIs& uris,
- const URI& plugin_uri,
- const Raul::Path& path)
- : ObjectModel(uris, path)
- , _plugin_uri(plugin_uri)
- , _num_values(0)
- , _min_values(nullptr)
- , _max_values(nullptr)
+BlockModel::BlockModel(URIs& uris, URI plugin_uri, const Raul::Path& path)
+ : ObjectModel(uris, path)
+ , _plugin_uri(std::move(plugin_uri))
+ , _num_values(0)
+ , _min_values(nullptr)
+ , _max_values(nullptr)
{
}