From 00348b34bb33ea42cc18ea56022fbed6fae26f54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Mon, 11 Mar 2024 21:48:31 +0100 Subject: [PATCH] Renamings --- nano/node/fair_queue.hpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/nano/node/fair_queue.hpp b/nano/node/fair_queue.hpp index b0af6e84d..e066ec894 100644 --- a/nano/node/fair_queue.hpp +++ b/nano/node/fair_queue.hpp @@ -91,23 +91,23 @@ private: }; public: - using source_type = origin; - using value_type = std::pair; + using origin_type = origin; + using value_type = std::pair; public: - size_t size (source_type source) const + size_t size (origin_type source) const { auto it = queues.find (source); return it == queues.end () ? 0 : it->second.size (); } - size_t max_size (source_type source) const + size_t max_size (origin_type source) const { auto it = queues.find (source); return it == queues.end () ? 0 : it->second.max_size; } - size_t priority (source_type source) const + size_t priority (origin_type source) const { auto it = queues.find (source); return it == queues.end () ? 0 : it->second.priority; @@ -159,14 +159,13 @@ public: * Request will be dropped if the queue is full * @return true if added, false if dropped */ - bool push (Request request, source_type source) + bool push (Request request, origin_type source) { auto it = queues.find (source); // Create a new queue if it doesn't exist if (it == queues.end ()) { - // TODO: Right now this is constant and initialized when the queue is created, but it could be made dynamic auto max_size = max_size_query (source); auto priority = priority_query (source); @@ -180,8 +179,8 @@ public: } public: - using max_size_query_t = std::function; - using priority_query_t = std::function; + using max_size_query_t = std::function; + using priority_query_t = std::function; max_size_query_t max_size_query{ [] (auto const & origin) { debug_assert (false, "max_size_query callback empty"); return 0; } }; priority_query_t priority_query{ [] (auto const & origin) { debug_assert (false, "priority_query callback empty"); return 0; } }; @@ -272,8 +271,8 @@ private: } private: - std::map queues; - std::map::iterator iterator{ queues.end () }; + std::map queues; + std::map::iterator iterator{ queues.end () }; size_t counter{ 0 }; std::chrono::steady_clock::time_point last_update{};