Skip to content

Commit fba574c

Browse files
author
MarcoFalke
committed
Merge #17349: Remove redundant copy constructors
fa89198 bench: Remove redundant copy constructor in mempool_stress (MarcoFalke) 29f8434 refactor: Remove redundant PSBT copy constructor (Hennadii Stepanov) Pull request description: I fail to see why people add these copy constructors manually without explanation, when the compiler can generate them at least as good automatically with less code. ACKs for top commit: promag: ACK fa89198. hebasto: ACK fa89198, nit s/constructor/operator/ in commit fa89198 message, as @promag [mentioned](bitcoin/bitcoin#17349 (comment)) above. jonatack: ACK fa89198 Tree-SHA512: ce024fdb894328f41037420b881169b8b1b48c87fbae5f432edf371a35c82e77e21468ef97cda6f54d34f1cf9bb010235d62904bb0669793457ed1c3b2a89723
2 parents def69e5 + fa89198 commit fba574c

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/bench/mempool_stress.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ struct Available {
2323
size_t vin_left{0};
2424
size_t tx_count;
2525
Available(CTransactionRef& ref, size_t tx_count) : ref(ref), tx_count(tx_count){}
26-
Available& operator=(Available other) {
27-
ref = other.ref;
28-
vin_left = other.vin_left;
29-
tx_count = other.tx_count;
30-
return *this;
31-
}
3226
};
3327

3428
static void ComplexMemPool(benchmark::State& state)
@@ -66,7 +60,7 @@ static void ComplexMemPool(benchmark::State& state)
6660
tx.vin.back().scriptSig = CScript() << coin.tx_count;
6761
tx.vin.back().scriptWitness.stack.push_back(CScriptNum(coin.tx_count).getvch());
6862
}
69-
if (coin.vin_left == coin.ref->vin.size()) {
63+
if (coin.vin_left == coin.ref->vin.size()) {
7064
coin = available_coins.back();
7165
available_coins.pop_back();
7266
}

src/psbt.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ struct PartiallySignedTransaction
401401
bool AddInput(const CTxIn& txin, PSBTInput& psbtin);
402402
bool AddOutput(const CTxOut& txout, const PSBTOutput& psbtout);
403403
PartiallySignedTransaction() {}
404-
PartiallySignedTransaction(const PartiallySignedTransaction& psbt_in) : tx(psbt_in.tx), inputs(psbt_in.inputs), outputs(psbt_in.outputs), unknown(psbt_in.unknown) {}
405404
explicit PartiallySignedTransaction(const CMutableTransaction& tx);
406405
/**
407406
* Finds the UTXO for a given input index

0 commit comments

Comments
 (0)