Skip to content

Commit 745bbdc

Browse files
committed
Merge #11161: Remove redundant explicitly defined copy ctors
b426e24 Remove redundant explicitly defined copy ctors (Dan Raviv) Pull request description: CFeeRate and CTxMemPoolEntry have explicitly defined copy ctors which has the same functionality as the implicit default copy ctors which would have been generated otherwise. Besides being redundant, it violates the rule of three (see https://en.wikipedia.org/wiki/Rule_of_three_(C%2B%2B_programming) ). (Of course, the rule of three doesn't -really- cause a resource management issue here, but the reason for that is exactly that there is no need for an explicit copy ctor in the first place since no resources are being managed). Tree-SHA512: c9294ebf5d955d230b44c6f0d20822975d44a34471a717d656f8b17181bcd2827f47ba897edf5accd650f5998c58aadc8ab3c91a3f556f1f6de36830ed4069ce
2 parents 2982511 + b426e24 commit 745bbdc

File tree

3 files changed

+0
-8
lines changed

3 files changed

+0
-8
lines changed

src/policy/feerate.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class CFeeRate
2626
explicit CFeeRate(const CAmount& _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) { }
2727
/** Constructor for a fee rate in satoshis per kB. The size in bytes must not exceed (2^63 - 1)*/
2828
CFeeRate(const CAmount& nFeePaid, size_t nBytes);
29-
CFeeRate(const CFeeRate& other) { nSatoshisPerK = other.nSatoshisPerK; }
3029
/**
3130
* Return the fee in satoshis for the given size in bytes.
3231
*/

src/txmempool.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ CTxMemPoolEntry::CTxMemPoolEntry(const CTransactionRef& _tx, const CAmount& _nFe
3939
nSigOpCostWithAncestors = sigOpCost;
4040
}
4141

42-
CTxMemPoolEntry::CTxMemPoolEntry(const CTxMemPoolEntry& other)
43-
{
44-
*this = other;
45-
}
46-
4742
void CTxMemPoolEntry::UpdateFeeDelta(int64_t newFeeDelta)
4843
{
4944
nModFeesWithDescendants += newFeeDelta - feeDelta;

src/txmempool.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ class CTxMemPoolEntry
9595
bool spendsCoinbase,
9696
int64_t nSigOpsCost, LockPoints lp);
9797

98-
CTxMemPoolEntry(const CTxMemPoolEntry& other);
99-
10098
const CTransaction& GetTx() const { return *this->tx; }
10199
CTransactionRef GetSharedTx() const { return this->tx; }
102100
const CAmount& GetFee() const { return nFee; }

0 commit comments

Comments
 (0)