forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Masternode classes: Remove repeated/un-needed code and data (#1572)
* Remove un-needed #includes (what is the policy?) Data was duplicated in masternode_info_t and CMasternode classes: * CMasternode is changed to inherit from masternode_info_t so the data members are inherited rather than repeated (also inherits unrepeated nTimeLastPing and fInfoValid members; this slight intrusiveness made up for in simplicity). * Use in-class member initializers (C++11) for defaults, so only non-default initializers are required in the lists. Allows to shorten repetitous constructor initializer lists. This makes checking for uninitialized data simpler. * Default constructors are defined as "= default;" if possible. * masternode_info_t is changed to behave like an aggregate (but requires over-complicated constructors until c++14). There are pros and cons here - aggregate initialization is convenient but implicit). * Removed user-defined swap functions. They appear to only be used in operator= definitions, using the copy-in,swap-and-return idiom: * Default operator=, where possible. * Move in class `friend bool operator==` out-of-class.
- Loading branch information
Showing
2 changed files
with
135 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.