aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authormerge-script <fanquake@gmail.com>2024-08-09 09:51:19 +0100
committermerge-script <fanquake@gmail.com>2024-08-09 09:51:19 +0100
commit24ced5274438c0185963ae1296ec7dda97ea62f1 (patch)
tree968afaf57b100d676bdeaa2676af4f86e6d4d0b6 /src/node
parent27a770b34b8f1dbb84760f442edb3e23a0c2420b (diff)
parent2925bd537cbd8c70594e23f6c4298b7101f7f73d (diff)
Merge bitcoin/bitcoin#28687: C++20 std::views::reverse
2925bd537cbd8c70594e23f6c4298b7101f7f73d refactor: use c++20 std::views::reverse instead of reverse_iterator.h (stickies-v) Pull request description: C++20 introduces [`std::ranges::views::reverse`](https://en.cppreference.com/w/cpp/ranges/reverse_view), which allows us to drop our own `reverse_iterator.h` implementation and also makes it easier to chain views (even though I think we currently don't use this). ACKs for top commit: achow101: ACK 2925bd537cbd8c70594e23f6c4298b7101f7f73d maflcko: ACK 2925bd537cbd8c70594e23f6c4298b7101f7f73d 🎷 Tree-SHA512: 567666ec44af5d1beb7a271836bcc89c4c577abc77f522fcc18bc6d4de516ae9b0df766d0bfa6dd217569e6878331c2aee1d9815620860375e3510dad7fed476
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) {