refactor: drop some unneeded this and const

This commit is contained in:
pasta 2024-08-28 12:00:01 -05:00
parent 9bcda44b2e
commit 7e9dec290f
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984
2 changed files with 5 additions and 5 deletions

View File

@ -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;
});

View File

@ -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;
}