diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-01-24 16:28:03 +0100 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-01-24 16:28:08 +0100 |
commit | 30f553d45797847166109a161628dba3bf00bc94 (patch) | |
tree | 8b0a85479978d57beaf5f20afe8d6356b37e00a5 /src/script | |
parent | 3ce7b27124f1570195eb5d171bf5b7ca769e333f (diff) | |
parent | 1308b837dc3499896ca73eafa51ac69b455cef00 (diff) |
Merge bitcoin/bitcoin#26707: clang-tidy: Fix `performance-*move*` warnings in headers
1308b837dc3499896ca73eafa51ac69b455cef00 clang-tidy: Fix `performance-no-automatic-move` in headers (Hennadii Stepanov)
0a5dc030b92a78147787f158d6a5de234ffa8ba4 clang-tidy: Fix `performance-move-const-arg` in headers (Hennadii Stepanov)
Pull request description:
Split from bitcoin/bitcoin#26705 as was requested in https://github.com/bitcoin/bitcoin/pull/26705#issuecomment-1353293405.
To test this PR, consider applying a diff as follows:
```diff
--- a/src/.clang-tidy
+++ b/src/.clang-tidy
@@ -1,16 +1,7 @@
Checks: '
-*,
-bugprone-argument-comment,
-bugprone-use-after-move,
-misc-unused-using-decls,
-modernize-use-default-member-init,
-modernize-use-nullptr,
-performance-for-range-copy,
performance-move-const-arg,
performance-no-automatic-move,
-performance-unnecessary-copy-initialization,
-readability-redundant-declaration,
-readability-redundant-string-init,
'
WarningsAsErrors: '
bugprone-argument-comment,
@@ -28,4 +19,4 @@ readability-redundant-string-init,
CheckOptions:
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: false
-HeaderFilterRegex: './qt'
+HeaderFilterRegex: '.'
```
ACKs for top commit:
fanquake:
ACK 1308b837dc3499896ca73eafa51ac69b455cef00
Tree-SHA512: b7ef9a3e789846130ab4c3fd6fbe8d887bdbcd438e4cbc78e2b1ac01f819ae13d7f69c2a25f480bd36e3e7f58886a7d5a8609a3c3275c315e0697cd4010474bd
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/miniscript.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/miniscript.h b/src/script/miniscript.h index fa3b0350e9..3a3f724f03 100644 --- a/src/script/miniscript.h +++ b/src/script/miniscript.h @@ -1378,7 +1378,7 @@ inline NodeRef<Key> Parse(Span<const char> in, const Ctx& ctx) assert(constructed.size() == 1); assert(constructed[0]->ScriptSize() == script_size); if (in.size() > 0) return {}; - const NodeRef<Key> tl_node = std::move(constructed.front()); + NodeRef<Key> tl_node = std::move(constructed.front()); tl_node->DuplicateKeyCheck(ctx); return tl_node; } @@ -1813,7 +1813,7 @@ inline NodeRef<Key> DecodeScript(I& in, I last, const Ctx& ctx) } } if (constructed.size() != 1) return {}; - const NodeRef<Key> tl_node = std::move(constructed.front()); + NodeRef<Key> 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. |