From 1c6594aa2779bb76909eaa285b4ce2c204471450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Tue, 26 Nov 2024 19:52:32 +0100 Subject: [PATCH] Improve `backlog_index::next ()` --- nano/node/bounded_backlog.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nano/node/bounded_backlog.cpp b/nano/node/bounded_backlog.cpp index 094cf219a9..71f6536749 100644 --- a/nano/node/bounded_backlog.cpp +++ b/nano/node/bounded_backlog.cpp @@ -485,11 +485,9 @@ std::deque nano::backlog_index::next (nano::block_hash last, s auto it = blocks.get ().upper_bound (last); auto end = blocks.get ().end (); - while (it != end && results.size () < count) + for (; it != end && results.size () < count; ++it) { results.push_back (it->hash); - last = it->hash; - it = blocks.get ().upper_bound (last); } return results; }