mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
Merge bitcoin/bitcoin#26749: refactor: Use move semantics instead of custom swap functions
95ad70ab65test: Default initialize `should_freeze` to `true` (Hennadii Stepanov)cea50521ferefactor: Drop no longer used `swap` member functions (Hennadii Stepanov)a87fb6bee5clang-tidy: Fix modernize-use-default-member-init in `CScriptCheck` (Hennadii Stepanov)b4bed5c1f9refactor: Drop no longer used `CScriptCheck()` default constructor (Hennadii Stepanov)d8427cc28erefactor: Use move semantics in `CCheckQueue::Loop` (Hennadii Stepanov)9a0b524139clang-tidy, test: Fix bugprone-use-after-move in `Correct_Queue_range()` (Hennadii Stepanov)04831fee6drefactor: Make move semantics explicit for callers (Hennadii Stepanov)6c2d5972f3refactor: Use move semantics in `CCheckQueue::Add` (Hennadii Stepanov)0682003214test, refactor: Avoid `CScriptCheck::swap` in `transaction_tests` (Hennadii Stepanov)15209d97c6consensus, refactor: Avoid `CScriptCheck::swap` in `CheckInputScripts` (Hennadii Stepanov) Pull request description: This PR makes code more succinct and readable by using move semantics. ACKs for top commit: martinus: re-ACK95ad70ab65achow101: ACK95ad70ab65TheCharlatan: re-ACK95ad70ab65MarcoFalke: re-ACK95ad70ab65🚥 Tree-SHA512: adda760891b12d252dc9b823fe7c41eed660364b6fb1a69f17607d7a31eb0bbb82a80d154a7acfaa241b5de37d42a293c2b6e059f26a8e92d88d3a87c99768fb
This commit is contained in:
@@ -1815,8 +1815,7 @@ bool CheckInputScripts(const CTransaction& tx, TxValidationState& state,
|
||||
// Verify signature
|
||||
CScriptCheck check(txdata.m_spent_outputs[i], tx, i, flags, cacheSigStore, &txdata);
|
||||
if (pvChecks) {
|
||||
pvChecks->push_back(CScriptCheck());
|
||||
check.swap(pvChecks->back());
|
||||
pvChecks->emplace_back(std::move(check));
|
||||
} else if (!check()) {
|
||||
if (flags & STANDARD_NOT_MANDATORY_VERIFY_FLAGS) {
|
||||
// Check whether the failure was caused by a
|
||||
@@ -2325,7 +2324,7 @@ bool Chainstate::ConnectBlock(const CBlock& block, BlockValidationState& state,
|
||||
return error("ConnectBlock(): CheckInputScripts on %s failed with %s",
|
||||
tx.GetHash().ToString(), state.ToString());
|
||||
}
|
||||
control.Add(vChecks);
|
||||
control.Add(std::move(vChecks));
|
||||
}
|
||||
|
||||
CTxUndo undoDummy;
|
||||
|
||||
Reference in New Issue
Block a user