From 7e9dec290f970467c1426b3302fa3cfbe6126e8c Mon Sep 17 00:00:00 2001 From: pasta Date: Wed, 28 Aug 2024 12:00:01 -0500 Subject: [PATCH] refactor: drop some unneeded `this` and `const` --- src/evo/deterministicmns.h | 8 ++++---- src/evo/dmn_types.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/evo/deterministicmns.h b/src/evo/deterministicmns.h index 59c7673d52..049dfe8eb3 100644 --- a/src/evo/deterministicmns.h +++ b/src/evo/deterministicmns.h @@ -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; }); diff --git a/src/evo/dmn_types.h b/src/evo/dmn_types.h index cc47948563..7391f740bb 100644 --- a/src/evo/dmn_types.h +++ b/src/evo/dmn_types.h @@ -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; }