aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorstickies-v <stickies-v@protonmail.com>2023-10-19 12:46:32 +0100
committerstickies-v <stickies-v@protonmail.com>2024-08-06 00:23:38 +0100
commit2925bd537cbd8c70594e23f6c4298b7101f7f73d (patch)
tree55c109ee30047fb02aecd17b869b72dc1360e6bb /src/node
parent949b67347255c0f2494055cbcdbb729a6476ded7 (diff)
refactor: use c++20 std::views::reverse instead of reverse_iterator.h
Use std::ranges::views::reverse instead of the implementation in reverse_iterator.h, and remove it as it is no longer used.
Diffstat (limited to 'src/node')
-rw-r--r--src/node/blockstorage.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp
index 4cff587d51..96cf69927c 100644
--- a/src/node/blockstorage.cpp
+++ b/src/node/blockstorage.cpp
@@ -20,7 +20,6 @@
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <random.h>
-#include <reverse_iterator.h>
#include <serialize.h>
#include <signet.h>
#include <span.h>
@@ -38,6 +37,7 @@
#include <validation.h>
#include <map>
+#include <ranges>
#include <unordered_map>
namespace kernel {
@@ -579,7 +579,7 @@ const CBlockIndex* BlockManager::GetLastCheckpoint(const CCheckpointData& data)
{
const MapCheckpoints& checkpoints = data.mapCheckpoints;
- for (const MapCheckpoints::value_type& i : reverse_iterate(checkpoints)) {
+ for (const MapCheckpoints::value_type& i : checkpoints | std::views::reverse) {
const uint256& hash = i.second;
const CBlockIndex* pindex = LookupBlockIndex(hash);
if (pindex) {