Skip to content

Commit

Permalink
Use deque rather than vector for vote_cache::top results.
Browse files Browse the repository at this point in the history
  • Loading branch information
clemahieu committed May 17, 2024
1 parent 5e5cd37 commit 5142047
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions nano/node/vote_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ void nano::vote_cache::clear ()
cache.clear ();
}

std::vector<nano::vote_cache::top_entry> nano::vote_cache::top (const nano::uint128_t & min_tally)
std::deque<nano::vote_cache::top_entry> nano::vote_cache::top (const nano::uint128_t & min_tally)
{
stats.inc (nano::stat::type::vote_cache, nano::stat::detail::top);

std::vector<top_entry> results;
std::deque<top_entry> results;
{
nano::lock_guard<nano::mutex> lock{ mutex };

Expand Down
2 changes: 1 addition & 1 deletion nano/node/vote_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class vote_cache final
* The blocks are sorted in descending order by final tally, then by tally
* @param min_tally minimum tally threshold, entries below with their voting weight below this will be ignored
*/
std::vector<top_entry> top (nano::uint128_t const & min_tally);
std::deque<top_entry> top (nano::uint128_t const & min_tally);

public: // Container info
std::unique_ptr<nano::container_info_component> collect_container_info (std::string const & name) const;
Expand Down

0 comments on commit 5142047

Please sign in to comment.