aboutsummaryrefslogtreecommitdiff
path: root/src/bloom.cpp
diff options
context:
space:
mode:
authorロハン ダル <rohun-dhar@MN14042102.local>2017-02-13 14:39:48 +0900
committerロハン ダル <rohun-dhar@MN14042102.local>2017-02-13 14:39:48 +0900
commit64aa36e20368fa16d4ff757d56dc2690ed0f48ba (patch)
tree6d6e54064be812d02932a9e1fdee55d70b618967 /src/bloom.cpp
parentd978c41e1ec4fcf2c4d096f09af035f9e8a7ad81 (diff)
downloadbitcoin-64aa36e20368fa16d4ff757d56dc2690ed0f48ba.tar.xz
param variables made const
Diffstat (limited to 'src/bloom.cpp')
-rw-r--r--src/bloom.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bloom.cpp b/src/bloom.cpp
index 8d47cb76e8..860bc0211e 100644
--- a/src/bloom.cpp
+++ b/src/bloom.cpp
@@ -19,7 +19,7 @@
#define LN2SQUARED 0.4804530139182014246671025263266649717305529515945455
#define LN2 0.6931471805599453094172321214581765680755001343602552
-CBloomFilter::CBloomFilter(unsigned int nElements, double nFPRate, unsigned int nTweakIn, unsigned char nFlagsIn) :
+CBloomFilter::CBloomFilter(const unsigned int nElements, const double nFPRate, const unsigned int nTweakIn, unsigned char nFlagsIn) :
/**
* The ideal size for a bloom filter with a given number of elements and false positive rate is:
* - nElements * log(fp rate) / ln(2)^2
@@ -40,7 +40,7 @@ CBloomFilter::CBloomFilter(unsigned int nElements, double nFPRate, unsigned int
}
// Private constructor used by CRollingBloomFilter
-CBloomFilter::CBloomFilter(unsigned int nElements, double nFPRate, unsigned int nTweakIn) :
+CBloomFilter::CBloomFilter(const unsigned int nElements, const double nFPRate, const unsigned int nTweakIn) :
vData((unsigned int)(-1 / LN2SQUARED * nElements * log(nFPRate)) / 8),
isFull(false),
isEmpty(true),
@@ -120,7 +120,7 @@ void CBloomFilter::clear()
isEmpty = true;
}
-void CBloomFilter::reset(unsigned int nNewTweak)
+void CBloomFilter::reset(const unsigned int nNewTweak)
{
clear();
nTweak = nNewTweak;
@@ -214,7 +214,7 @@ void CBloomFilter::UpdateEmptyFull()
isEmpty = empty;
}
-CRollingBloomFilter::CRollingBloomFilter(unsigned int nElements, double fpRate)
+CRollingBloomFilter::CRollingBloomFilter(const unsigned int nElements, const double fpRate)
{
double logFpRate = log(fpRate);
/* The optimal number of hash functions is log(fpRate) / log(0.5), but