diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-08-28 09:43:39 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-08-28 09:43:49 +0200 |
commit | 745bbdc189b29cd42eb93b9b00fb2cf7ab6f49b5 (patch) | |
tree | 62642f3ba9222036255d5761801082a2fea6a375 /src | |
parent | 298251161c7b637157885420b35d7601e072923b (diff) | |
parent | b426e24678eb65d791cb505011e3ba4655aef1cd (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/policy/feerate.h | 1 | ||||
-rw-r--r-- | src/txmempool.cpp | 5 | ||||
-rw-r--r-- | src/txmempool.h | 2 |
3 files changed, 0 insertions, 8 deletions
diff --git a/src/policy/feerate.h b/src/policy/feerate.h index 565da6c154..7e519e3efa 100644 --- a/src/policy/feerate.h +++ b/src/policy/feerate.h @@ -26,7 +26,6 @@ public: explicit CFeeRate(const CAmount& _nSatoshisPerK): nSatoshisPerK(_nSatoshisPerK) { } /** Constructor for a fee rate in satoshis per kB. The size in bytes must not exceed (2^63 - 1)*/ CFeeRate(const CAmount& nFeePaid, size_t nBytes); - CFeeRate(const CFeeRate& other) { nSatoshisPerK = other.nSatoshisPerK; } /** * Return the fee in satoshis for the given size in bytes. */ diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 4a81055231..f68d677646 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -39,11 +39,6 @@ CTxMemPoolEntry::CTxMemPoolEntry(const CTransactionRef& _tx, const CAmount& _nFe nSigOpCostWithAncestors = sigOpCost; } -CTxMemPoolEntry::CTxMemPoolEntry(const CTxMemPoolEntry& other) -{ - *this = other; -} - void CTxMemPoolEntry::UpdateFeeDelta(int64_t newFeeDelta) { nModFeesWithDescendants += newFeeDelta - feeDelta; diff --git a/src/txmempool.h b/src/txmempool.h index 5b0db5266e..65586a6e6e 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -95,8 +95,6 @@ public: bool spendsCoinbase, int64_t nSigOpsCost, LockPoints lp); - CTxMemPoolEntry(const CTxMemPoolEntry& other); - const CTransaction& GetTx() const { return *this->tx; } CTransactionRef GetSharedTx() const { return this->tx; } const CAmount& GetFee() const { return nFee; } |