Skip to content

Commit a74b1e2

Browse files
fanquakePastaPastaPasta
authored andcommitted
Merge bitcoin#30253: refactor: performance-for-range-copy in psbt.h
fab01b5 refactor: performance-for-range-copy in psbt.h (MarcoFalke) Pull request description: A copy of the partial signatures is not required before serializing them. For reference, this was found by switching the codebase to `std::span` (not sure why it wasn't found with `Span` though): ``` ./psbt.h:240:23: error: loop variable is copied but only used as const reference; consider making it a const reference [performance-for-range-copy,-warnings-as-errors] 240 | for (auto sig_pair : partial_sigs) { | ^ | const & ACKs for top commit: tdb3: ACK fab01b5 theStack: utACK fab01b5 Tree-SHA512: b55513d8191118499716684190ee568d171b50ae9171d246ca6e047f0cfd3ec14c9453d721e88af55e47bb41fa66cbafdbfb47bc5f9b8d82789e0a9b634b371b
1 parent 2ea479f commit a74b1e2

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
@@ -192,7 +192,7 @@ struct PSBTInput
192192

193193
if (final_script_sig.empty()) {
194194
// Write any partial signatures
195-
for (auto sig_pair : partial_sigs) {
195+
for (const auto& sig_pair : partial_sigs) {
196196
SerializeToVector(s, CompactSizeWriter(PSBT_IN_PARTIAL_SIG), Span{sig_pair.second.first});
197197
s << sig_pair.second.second;
198198
}

0 commit comments

Comments
 (0)