Skip to content

Commit 8ea8c92

Browse files
committed
index: Avoid unnecessary type casts in coinstatsindex
1 parent b295395 commit 8ea8c92

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/index/coinstatsindex.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ bool CoinStatsIndex::WriteBlock(const CBlock& block, const CBlockIndex* pindex)
143143
continue;
144144
}
145145

146-
for (size_t j = 0; j < tx->vout.size(); ++j) {
146+
for (uint32_t j = 0; j < tx->vout.size(); ++j) {
147147
const CTxOut& out{tx->vout[j]};
148148
Coin coin{out, pindex->nHeight, tx->IsCoinBase()};
149-
COutPoint outpoint{tx->GetHash(), static_cast<uint32_t>(j)};
149+
COutPoint outpoint{tx->GetHash(), j};
150150

151151
// Skip unspendable coins
152152
if (coin.out.scriptPubKey.IsUnspendable()) {
@@ -402,9 +402,9 @@ bool CoinStatsIndex::ReverseBlock(const CBlock& block, const CBlockIndex* pindex
402402
for (size_t i = 0; i < block.vtx.size(); ++i) {
403403
const auto& tx{block.vtx.at(i)};
404404

405-
for (size_t j = 0; j < tx->vout.size(); ++j) {
405+
for (uint32_t j = 0; j < tx->vout.size(); ++j) {
406406
const CTxOut& out{tx->vout[j]};
407-
COutPoint outpoint{tx->GetHash(), static_cast<uint32_t>(j)};
407+
COutPoint outpoint{tx->GetHash(), j};
408408
Coin coin{out, pindex->nHeight, tx->IsCoinBase()};
409409

410410
// Skip unspendable coins

0 commit comments

Comments
 (0)