mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 06:43:45 +01:00
Merge bitcoin/bitcoin#28583: refactor: [tidy] modernize-use-emplace
fa05a726c2tidy: modernize-use-emplace (MarcoFalke) Pull request description: Constructing a temporary unnamed object only to copy or move it into a container seems both verbose in code and a strict performance penalty. Fix both issues via the `modernize-use-emplace` tidy check. ACKs for top commit: Sjors: re-utACKfa05a726c2hebasto: ACKfa05a726c2. TheCharlatan: ACKfa05a726c2Tree-SHA512: 4408a094f406e7bf6c1468c2b0798f68f4d952a1253cf5b20bdc648ad7eea4a2c070051fed46d66fd37bce2ce6f85962484a1d32826b7ab8c9baba431eaa2765
This commit is contained in:
@@ -1015,7 +1015,7 @@ CScript ScriptPubKey(MsCtx ctx, const CScript& script, TaprootBuilder& builder)
|
||||
//! Fill the witness with the data additional to the script satisfaction.
|
||||
void SatisfactionToWitness(MsCtx ctx, CScriptWitness& witness, const CScript& script, TaprootBuilder& builder) {
|
||||
// For P2WSH, it's only the witness script.
|
||||
witness.stack.push_back(std::vector<unsigned char>(script.begin(), script.end()));
|
||||
witness.stack.emplace_back(script.begin(), script.end());
|
||||
if (!miniscript::IsTapscript(ctx)) return;
|
||||
// For Tapscript we also need the control block.
|
||||
witness.stack.push_back(*builder.GetSpendData().scripts.begin()->second.begin());
|
||||
|
||||
Reference in New Issue
Block a user