Skip to content

Commit f1ed1d3

Browse files
committed
bloom: use constexpr where appropriate
1 parent 2ba4ddf commit f1ed1d3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/bloom.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
#include <algorithm>
1818

19-
#define LN2SQUARED 0.4804530139182014246671025263266649717305529515945455
20-
#define LN2 0.6931471805599453094172321214581765680755001343602552
19+
static constexpr double LN2SQUARED = 0.4804530139182014246671025263266649717305529515945455;
20+
static constexpr double LN2 = 0.6931471805599453094172321214581765680755001343602552;
2121

2222
CBloomFilter::CBloomFilter(const unsigned int nElements, const double nFPRate, const unsigned int nTweakIn, unsigned char nFlagsIn) :
2323
/**

src/bloom.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class COutPoint;
1313
class CTransaction;
1414

1515
//! 20,000 items with fp rate < 0.1% or 10,000 items and <0.0001%
16-
static const unsigned int MAX_BLOOM_FILTER_SIZE = 36000; // bytes
17-
static const unsigned int MAX_HASH_FUNCS = 50;
16+
static constexpr unsigned int MAX_BLOOM_FILTER_SIZE = 36000; // bytes
17+
static constexpr unsigned int MAX_HASH_FUNCS = 50;
1818

1919
/**
2020
* First two bits of nFlags control how much IsRelevantAndUpdate actually updates

0 commit comments

Comments
 (0)