mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
refactor: drop some unneeded this
and const
This commit is contained in:
parent
9bcda44b2e
commit
7e9dec290f
@ -239,22 +239,22 @@ public:
|
||||
|
||||
[[nodiscard]] size_t GetValidMNsCount() const
|
||||
{
|
||||
return ranges::count_if(mnMap, [this](const auto& p){ return IsMNValid(*p.second); });
|
||||
return ranges::count_if(mnMap, [](const auto& p){ return IsMNValid(*p.second); });
|
||||
}
|
||||
|
||||
[[nodiscard]] size_t GetAllEvoCount() const
|
||||
{
|
||||
return ranges::count_if(mnMap, [this](const auto& p) { return p.second->nType == MnType::Evo; });
|
||||
return ranges::count_if(mnMap, [](const auto& p) { return p.second->nType == MnType::Evo; });
|
||||
}
|
||||
|
||||
[[nodiscard]] size_t GetValidEvoCount() const
|
||||
{
|
||||
return ranges::count_if(mnMap, [this](const auto& p) { return p.second->nType == MnType::Evo && IsMNValid(*p.second); });
|
||||
return ranges::count_if(mnMap, [](const auto& p) { return p.second->nType == MnType::Evo && IsMNValid(*p.second); });
|
||||
}
|
||||
|
||||
[[nodiscard]] size_t GetValidWeightedMNsCount() const
|
||||
{
|
||||
return std::accumulate(mnMap.begin(), mnMap.end(), 0, [this](auto res, const auto& p) {
|
||||
return std::accumulate(mnMap.begin(), mnMap.end(), 0, [](auto res, const auto& p) {
|
||||
if (!IsMNValid(*p.second)) return res;
|
||||
return res + GetMnType(p.second->nType).voting_weight;
|
||||
});
|
||||
|
@ -62,7 +62,7 @@ constexpr auto Invalid = mntype_struct{
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr const bool IsValidMnType(MnType type)
|
||||
[[nodiscard]] constexpr bool IsValidMnType(MnType type)
|
||||
{
|
||||
return type < MnType::COUNT;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user