Skip to content

Commit cb32328

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#26710: refactor: Fix performance-for-range-copy in headers
48033d4 clang-tidy: Fix `performance-for-range-copy` in headers (Hennadii Stepanov) Pull request description: Split from bitcoin/bitcoin#26705 as was requested in bitcoin/bitcoin#26705 (comment). To test this PR, consider applying a diff as follows: ```diff --- a/src/.clang-tidy +++ b/src/.clang-tidy @@ -12,17 +12,9 @@ readability-redundant-declaration, readability-redundant-string-init, ' WarningsAsErrors: ' -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-unnecessary-copy-initialization, -readability-redundant-declaration, -readability-redundant-string-init, ' CheckOptions: - key: performance-move-const-arg.CheckTriviallyCopyableMove value: false +HeaderFilterRegex: '.' ``` ACKs for top commit: MarcoFalke: review ACK 48033d4 Tree-SHA512: eaf7a0e9b4fdc4ce788f78e5675632f3c278fc24bee2434874cbabc3e25ad7059b0c53ab7834908e901872d5afee08acba860542b03454c09fe129be6ad03f09
2 parents 6c01323 + 48033d4 commit cb32328

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/psbt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ void SerializeHDKeypath(Stream& s, KeyOriginInfo hd_keypath)
178178
template<typename Stream>
179179
void SerializeHDKeypaths(Stream& s, const std::map<CPubKey, KeyOriginInfo>& hd_keypaths, CompactSizeWriter type)
180180
{
181-
for (auto keypath_pair : hd_keypaths) {
181+
for (const auto& keypath_pair : hd_keypaths) {
182182
if (!keypath_pair.first.IsValid()) {
183183
throw std::ios_base::failure("Invalid CPubKey being serialized");
184184
}

0 commit comments

Comments
 (0)