mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-29 05:22:30 +02:00
Merge bitcoin/bitcoin#30253: refactor: performance-for-range-copy in psbt.h
fab01b5220
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: ACKfab01b5220
theStack: utACKfab01b5220
Tree-SHA512: b55513d8191118499716684190ee568d171b50ae9171d246ca6e047f0cfd3ec14c9453d721e88af55e47bb41fa66cbafdbfb47bc5f9b8d82789e0a9b634b371b
This commit is contained in:
commit
ea88a7596e
@ -237,7 +237,7 @@ struct PSBTInput
|
||||
|
||||
if (final_script_sig.empty() && final_script_witness.IsNull()) {
|
||||
// Write any partial signatures
|
||||
for (auto sig_pair : partial_sigs) {
|
||||
for (const auto& sig_pair : partial_sigs) {
|
||||
SerializeToVector(s, CompactSizeWriter(PSBT_IN_PARTIAL_SIG), Span{sig_pair.second.first});
|
||||
s << sig_pair.second.second;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user