mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge bitcoin/bitcoin#25748: refactor: Avoid copies in FlatSigningProvider Merge
fa3f15f2ddrefactor: Avoid copies in FlatSigningProvider Merge (MacroFake) Pull request description: `Merge` will create several copies unconditionally: * To initialize the args `a`, and `b` * `ret`, which is the merge of the two args So change the code to let the caller decide how many copies they need/want: * `a`, and `b` must be explicitly moved or copied by the caller * `ret` is no longer needed, as `a` can be used for it in place "for free" ACKs for top commit: achow101: ACKfa3f15f2ddfurszy: looks good, ACKfa3f15f2ryanofsky: Code review ACKfa3f15f2dd. Confirmed that all the places `std::move` was added the argument actually did seem safe to move from. Compiler enforces that temporary copies are explicitly created in non-move cases. Tree-SHA512: 7c027ccdea1549cd9f37403344ecbb76e008adf545f6ce52996bf95e89eb7dc89af6cb31435a9289d6f2eea1c416961b2fb96348bc8a211d550728f1d99ac49c
This commit is contained in:
@@ -644,7 +644,7 @@ void FundTransaction(CWallet& wallet, CMutableTransaction& tx, CAmount& fee_out,
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Unable to parse descriptor '%s': %s", desc_str, error));
|
||||
}
|
||||
desc->Expand(0, desc_out, scripts_temp, desc_out);
|
||||
coinControl.m_external_provider = Merge(coinControl.m_external_provider, desc_out);
|
||||
coinControl.m_external_provider.Merge(std::move(desc_out));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user