mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-19 06:30:45 +02:00
refactor: Improve CRollingBloomFilter::reset by using std::fill
This commit is contained in:
parent
d2dbc7da26
commit
df9e15f092
@ -14,6 +14,7 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#define LN2SQUARED 0.4804530139182014246671025263266649717305529515945455
|
#define LN2SQUARED 0.4804530139182014246671025263266649717305529515945455
|
||||||
#define LN2 0.6931471805599453094172321214581765680755001343602552
|
#define LN2 0.6931471805599453094172321214581765680755001343602552
|
||||||
@ -304,7 +305,5 @@ void CRollingBloomFilter::reset()
|
|||||||
nTweak = GetRand(std::numeric_limits<unsigned int>::max());
|
nTweak = GetRand(std::numeric_limits<unsigned int>::max());
|
||||||
nEntriesThisGeneration = 0;
|
nEntriesThisGeneration = 0;
|
||||||
nGeneration = 1;
|
nGeneration = 1;
|
||||||
for (std::vector<uint64_t>::iterator it = data.begin(); it != data.end(); it++) {
|
std::fill(data.begin(), data.end(), 0);
|
||||||
*it = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user