Use range-based for loops (C++11) when looping over vector elements

This commit is contained in:
practicalswift
2017-05-18 09:42:14 +02:00
parent ea6fde3f1d
commit 211adc074a
5 changed files with 22 additions and 25 deletions
+2 -2
View File
@@ -604,8 +604,8 @@ void CBlockPolicyEstimator::processBlock(unsigned int nBlockHeight,
unsigned int countedTxs = 0;
// Update averages with data points from current block
for (unsigned int i = 0; i < entries.size(); i++) {
if (processBlockTx(nBlockHeight, entries[i]))
for (const auto& entry : entries) {
if (processBlockTx(nBlockHeight, entry))
countedTxs++;
}