Initialize members in initialization lists. Prefer in-class initializers to member initializers in constructors for constant initializers.
Rationale:
Initialize members in initialization lists. Prefer in-class initializers to member initializers in constructors for constant initializers.
Rationale:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
21- scriptSig = scriptSigIn;
22- nSequence = nSequenceIn;
23 }
24
25-CTxIn::CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn, uint32_t nSequenceIn)
26+CTxIn::CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn, uint32_t nSequenceIn) : prevout(COutPoint(hashPrevTx, nOut)), scriptSig(scriptSigIn), nSequence(nSequenceIn)
\n
before the :
to avoid having excessively long lines, no? (Feddback also applies to other places with long lines)
4356+CKeyPool::CKeyPool(const CPubKey& vchPubKeyIn, bool internalIn) : vchPubKey(vchPubKeyIn), fInternal(internalIn)
4357 {
4358 nTime = GetTime();
4359- vchPubKey = vchPubKeyIn;
4360- fInternal = internalIn;
4361 m_pre_split = false;
255@@ -256,7 +256,8 @@ class CScriptVisitor : public boost::static_visitor<bool>
256 private:
257 CScript *script;
258 public:
259- explicit CScriptVisitor(CScript *scriptin) { script = scriptin; }
260+ explicit CScriptVisitor(CScript *scriptin) : script(scriptin) {
261+ }
clang-format-diff.py
accepts at least:
0explicit CScriptVisitor(CScript* scriptin) : script(scriptin) {}
1explicit CScriptVisitor(CScript* scriptin) : script(scriptin)
2{
3}
For an empty set, like Marco I like the former.
CompareInvMempoolOrder
, FreespaceChecker
, etc.
@laanwj Now preferring in-class initializers to member initializers in constructors for constant initializers. Please re-review the PR.
Please note that a redundant call to filterInventoryKnown.reset()
has been removed. That looks correct, right?