From 4ce88b462173fe3be0d0880c572a1c4e6a67b9f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Sat, 25 May 2024 14:38:34 +0200 Subject: [PATCH] Optimize `vote_cache::collect_container_info` --- nano/node/vote_cache.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/nano/node/vote_cache.cpp b/nano/node/vote_cache.cpp index 3b3e2d978e..91d4061067 100644 --- a/nano/node/vote_cache.cpp +++ b/nano/node/vote_cache.cpp @@ -276,21 +276,8 @@ std::unique_ptr nano::vote_cache::collect_contai { nano::lock_guard guard{ mutex }; - auto count_unique_votes = [this] () { - std::unordered_set> votes; - for (auto const & entry : cache) - { - for (auto const & vote : entry.votes ()) - { - votes.insert (vote); - } - } - return votes.size (); - }; - auto composite = std::make_unique (name); composite->add_component (std::make_unique (container_info{ "cache", cache.size (), sizeof (ordered_cache::value_type) })); - composite->add_component (std::make_unique (container_info{ "unique", count_unique_votes (), sizeof (nano::vote) })); return composite; }