refactor: resolve cppcheck warnings (#4799)

This commit is contained in:
PastaPastaPasta 2022-04-25 04:34:05 -05:00 committed by GitHub
parent 407873e024
commit 2fe55acb4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 5 deletions

View File

@ -102,7 +102,7 @@ CBLSPublicKey CQuorum::GetPubKeyShare(size_t memberIdx) const
if (!HasVerificationVector() || memberIdx >= members.size() || !qc->validMembers[memberIdx]) {
return CBLSPublicKey();
}
auto& m = members[memberIdx];
const auto& m = members[memberIdx];
return blsCache.BuildPubKeyShare(m->proTxHash, quorumVvec, CBLSId(m->proTxHash));
}
@ -433,7 +433,6 @@ std::vector<CQuorumCPtr> CQuorumManager::ScanQuorums(Consensus::LLMQType llmqTyp
return {};
}
bool fCacheExists{false};
const CBlockIndex* pIndexScanCommitments{pindexStart};
size_t nScanCommitments{nCountRequested};
std::vector<CQuorumCPtr> vecResultQuorums;
@ -463,7 +462,7 @@ std::vector<CQuorumCPtr> CQuorumManager::ScanQuorums(Consensus::LLMQType llmqTyp
}
size_t nCountResult{vecResultQuorums.size()};
if (nCountResult > 0 && !fCacheExists) {
if (nCountResult > 0) {
LOCK(quorumsCacheCs);
// Don't cache more than cache.max_size() elements
auto& cache = scanQuorumsCache[llmqType];

View File

@ -22,7 +22,7 @@
/// Proposal wrapper
///
Proposal::Proposal(const CGovernanceObject _govObj, QObject* parent) :
Proposal::Proposal(const CGovernanceObject& _govObj, QObject* parent) :
QObject(parent),
govObj(_govObj)
{

View File

@ -63,7 +63,7 @@ private:
QString m_url;
public:
explicit Proposal(const CGovernanceObject _govObj, QObject* parent = nullptr);
explicit Proposal(const CGovernanceObject& _govObj, QObject* parent = nullptr);
QString title() const;
QString hash() const;
QDateTime startDate() const;