From c6f09af17f4427717102625e474beaccdf74054c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Thu, 7 Mar 2024 09:21:27 +0100 Subject: [PATCH] MSVC FIX --- nano/node/fair_queue.hpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/nano/node/fair_queue.hpp b/nano/node/fair_queue.hpp index 2701c33d45..a5af009125 100644 --- a/nano/node/fair_queue.hpp +++ b/nano/node/fair_queue.hpp @@ -193,17 +193,17 @@ class fair_queue_base final debug_assert (!empty ()); // Should be checked before calling next auto should_seek = [&, this] () { - if (current_queue == queues.end ()) + if (iterator == queues.end ()) { return true; } - auto & queue = current_queue->second; + auto & queue = iterator->second; if (queue.empty ()) { return true; } // Allow up to `queue.priority` requests to be processed before moving to the next queue - if (current_queue_counter >= queue.priority) + if (counter >= queue.priority) { return true; } @@ -215,12 +215,12 @@ class fair_queue_base final seek_next (); } - release_assert (current_queue != queues.end ()); + release_assert (iterator != queues.end ()); - auto & source = current_queue->first; - auto & queue = current_queue->second; + auto & source = iterator->first; + auto & queue = iterator->second; - ++current_queue_counter; + ++counter; return { queue.pop (), source }; } @@ -238,25 +238,25 @@ class fair_queue_base final private: void seek_next () { - current_queue_counter = 0; + counter = 0; do { - if (current_queue != queues.end ()) + if (iterator != queues.end ()) { - ++current_queue; + ++iterator; } - if (current_queue == queues.end ()) + if (iterator == queues.end ()) { - current_queue = queues.begin (); + iterator = queues.begin (); } - release_assert (current_queue != queues.end ()); - } while (current_queue->second.empty ()); + release_assert (iterator != queues.end ()); + } while (iterator->second.empty ()); } void cleanup () { // Invalidate the current iterator - current_queue = queues.end (); + iterator = queues.end (); erase_if (queues, [] (auto const & entry) { return !entry.first.alive (); @@ -265,8 +265,8 @@ class fair_queue_base final private: std::map queues; - decltype (queues)::iterator current_queue{ queues.end () }; - size_t current_queue_counter{ 0 }; + std::map::iterator iterator{ queues.end () }; + size_t counter{ 0 }; std::chrono::steady_clock::time_point last_cleanup{};