diff --git a/nano/node/repcrawler.cpp b/nano/node/repcrawler.cpp index f6cca66b5f..debb30cd40 100644 --- a/nano/node/repcrawler.cpp +++ b/nano/node/repcrawler.cpp @@ -452,8 +452,9 @@ std::vector nano::rep_crawler::representatives (std::size_ } std::vector result; - for (auto const & [weight, rep] : ordered | std::views::take (count)) + for (auto i = ordered.begin (), n = ordered.end (); i != n && result.size () < count; ++i) { + auto const & [weight, rep] = *i; result.push_back ({ rep.account, rep.channel }); } return result;