mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-04 10:46:19 +00:00
Merge bitcoin/bitcoin#30253: refactor: performance-for-range-copy in psbt.h
fab01b5220c28a334b451ed9625bd3914c48e6af 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 fab01b5220c28a334b451ed9625bd3914c48e6af
theStack:
utACK fab01b5220c28a334b451ed9625bd3914c48e6af
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…
x
Reference in New Issue
Block a user