Replace random_access with sequenced in vote_cache
(#3955)
This commit is contained in:
parent
84348f70e4
commit
752fc07d78
2 changed files with 5 additions and 5 deletions
|
@ -231,11 +231,11 @@ void nano::vote_cache::trim_overflow_locked ()
|
|||
// When cache overflown remove the oldest entry
|
||||
if (cache.size () > max_size)
|
||||
{
|
||||
cache.get<tag_random_access> ().pop_front ();
|
||||
cache.get<tag_sequenced> ().pop_front ();
|
||||
}
|
||||
if (queue.size () > max_size)
|
||||
{
|
||||
queue.get<tag_random_access> ().pop_front ();
|
||||
queue.get<tag_sequenced> ().pop_front ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ private:
|
|||
const std::size_t max_size;
|
||||
|
||||
// clang-format off
|
||||
class tag_random_access {};
|
||||
class tag_sequenced {};
|
||||
class tag_tally {};
|
||||
class tag_hash {};
|
||||
// clang-format on
|
||||
|
@ -150,7 +150,7 @@ private:
|
|||
// clang-format off
|
||||
using ordered_cache = boost::multi_index_container<entry,
|
||||
mi::indexed_by<
|
||||
mi::random_access<mi::tag<tag_random_access>>,
|
||||
mi::sequenced<mi::tag<tag_sequenced>>,
|
||||
mi::hashed_unique<mi::tag<tag_hash>,
|
||||
mi::member<entry, nano::block_hash, &entry::hash>>>>;
|
||||
// clang-format on
|
||||
|
@ -159,7 +159,7 @@ private:
|
|||
// clang-format off
|
||||
using ordered_queue = boost::multi_index_container<queue_entry,
|
||||
mi::indexed_by<
|
||||
mi::random_access<mi::tag<tag_random_access>>,
|
||||
mi::sequenced<mi::tag<tag_sequenced>>,
|
||||
mi::ordered_non_unique<mi::tag<tag_tally>,
|
||||
mi::member<queue_entry, nano::uint128_t, &queue_entry::tally>>,
|
||||
mi::hashed_unique<mi::tag<tag_hash>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue