From 0a5dc030b92a78147787f158d6a5de234ffa8ba4 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 17 Jan 2023 12:56:02 +0000 Subject: [PATCH 1/2] clang-tidy: Fix `performance-move-const-arg` in headers See https://clang.llvm.org/extra/clang-tidy/checks/performance/move-const-arg.html --- src/fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fs.h b/src/fs.h index 1a790e06826..0ece256acb5 100644 --- a/src/fs.h +++ b/src/fs.h @@ -35,7 +35,7 @@ class path : public std::filesystem::path // Allow path objects arguments for compatibility. path(std::filesystem::path path) : std::filesystem::path::path(std::move(path)) {} path& operator=(std::filesystem::path path) { std::filesystem::path::operator=(std::move(path)); return *this; } - path& operator/=(std::filesystem::path path) { std::filesystem::path::operator/=(std::move(path)); return *this; } + path& operator/=(std::filesystem::path path) { std::filesystem::path::operator/=(path); return *this; } // Allow literal string arguments, which are safe as long as the literals are ASCII. path(const char* c) : std::filesystem::path(c) {} From 1308b837dc3499896ca73eafa51ac69b455cef00 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 17 Jan 2023 12:56:18 +0000 Subject: [PATCH 2/2] clang-tidy: Fix `performance-no-automatic-move` in headers See https://clang.llvm.org/extra/clang-tidy/checks/performance/no-automatic-move.html --- src/script/miniscript.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/script/miniscript.h b/src/script/miniscript.h index fa3b0350e98..3a3f724f031 100644 --- a/src/script/miniscript.h +++ b/src/script/miniscript.h @@ -1378,7 +1378,7 @@ inline NodeRef Parse(Span in, const Ctx& ctx) assert(constructed.size() == 1); assert(constructed[0]->ScriptSize() == script_size); if (in.size() > 0) return {}; - const NodeRef tl_node = std::move(constructed.front()); + NodeRef tl_node = std::move(constructed.front()); tl_node->DuplicateKeyCheck(ctx); return tl_node; } @@ -1813,7 +1813,7 @@ inline NodeRef DecodeScript(I& in, I last, const Ctx& ctx) } } if (constructed.size() != 1) return {}; - const NodeRef tl_node = std::move(constructed.front()); + NodeRef tl_node = std::move(constructed.front()); tl_node->DuplicateKeyCheck(ctx); // Note that due to how ComputeType works (only assign the type to the node if the // subs' types are valid) this would fail if any node of tree is badly typed.