Skip to content

Commit ea88a75

Browse files
committed
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
2 parents a44b0f7 + fab01b5 commit ea88a75

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
@@ -237,7 +237,7 @@ struct PSBTInput
237237

238238
if (final_script_sig.empty() && final_script_witness.IsNull()) {
239239
// Write any partial signatures
240-
for (auto sig_pair : partial_sigs) {
240+
for (const auto& sig_pair : partial_sigs) {
241241
SerializeToVector(s, CompactSizeWriter(PSBT_IN_PARTIAL_SIG), Span{sig_pair.second.first});
242242
s << sig_pair.second.second;
243243
}

0 commit comments

Comments
 (0)