Page MenuHomePhabricator

Remove redundant explicitly defined copy ctors
ClosedPublic

Authored by Fabien on Dec 29 2018, 18:08.

Details

Summary

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).
CFeeRate has an explicitly defined copy ctor which has the same functionality as the implicit default copy ctor which would h
ave been generated otherwise.

Backport of core PR11161

Test Plan
make check

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Dec 29 2018, 18:08
Herald added a reviewer: Restricted Project. · View Herald TranscriptDec 29 2018, 18:08
Herald added a subscriber: schancel. · View Herald Transcript
deadalnix accepted this revision.Dec 30 2018, 12:14
This revision is now accepted and ready to land.Dec 30 2018, 12:14
Closed by commit rABC89264a44bb91: Remove redundant explicitly defined copy ctors (authored by Dan Raviv <dan@soundradix.com>, committed by Fabien). · Explain WhyDec 30 2018, 14:00
This revision was automatically updated to reflect the committed changes.