Skip to content

Commit df9e15f

Browse files
committed
refactor: Improve CRollingBloomFilter::reset by using std::fill
1 parent d2dbc7d commit df9e15f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/bloom.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <math.h>
1515
#include <stdlib.h>
1616

17+
#include <algorithm>
1718

1819
#define LN2SQUARED 0.4804530139182014246671025263266649717305529515945455
1920
#define LN2 0.6931471805599453094172321214581765680755001343602552
@@ -304,7 +305,5 @@ void CRollingBloomFilter::reset()
304305
nTweak = GetRand(std::numeric_limits<unsigned int>::max());
305306
nEntriesThisGeneration = 0;
306307
nGeneration = 1;
307-
for (std::vector<uint64_t>::iterator it = data.begin(); it != data.end(); it++) {
308-
*it = 0;
309-
}
308+
std::fill(data.begin(), data.end(), 0);
310309
}

0 commit comments

Comments
 (0)