refactor: use irange

This commit is contained in:
pasta 2024-10-29 13:18:47 -05:00
parent 4cc3ee6286
commit 2d05df04fd
No known key found for this signature in database
GPG Key ID: E2F3D7916E722D38

View File

@ -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;
} }