mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
refactor: use irange
This commit is contained in:
parent
4cc3ee6286
commit
2d05df04fd
@ -15,6 +15,7 @@
|
|||||||
#include <deploymentstatus.h>
|
#include <deploymentstatus.h>
|
||||||
#include <logging.h>
|
#include <logging.h>
|
||||||
#include <node/blockstorage.h>
|
#include <node/blockstorage.h>
|
||||||
|
#include <util/irange.h>
|
||||||
#include <validation.h>
|
#include <validation.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -164,7 +165,7 @@ CCreditPool CCreditPoolManager::ConstructCreditPool(const CBlockIndex* const blo
|
|||||||
}
|
}
|
||||||
|
|
||||||
const CBlockIndex* distant_block_index = block_index;
|
const CBlockIndex* distant_block_index = block_index;
|
||||||
for (auto i = 0; i < Params().CreditPoolPeriodBlocks(); ++i) {
|
for ([[maybe_unused]] auto _ : irange::range(Params().CreditPoolPeriodBlocks())) {
|
||||||
distant_block_index = distant_block_index->pprev;
|
distant_block_index = distant_block_index->pprev;
|
||||||
if (distant_block_index == nullptr) break;
|
if (distant_block_index == nullptr) break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user