aboutsummaryrefslogtreecommitdiff
path: root/src/bench
diff options
context:
space:
mode:
authorpracticalswift <[email protected]>2018-07-26 16:33:45 +0200
committerpracticalswift <[email protected]>2018-08-02 14:30:53 +0200
commitcdf4089457856bdfe336b6f4b337d7e1ea4fdbd3 (patch)
tree9c7e66306acaff0756d5a871b8556220f5a90bfa /src/bench
parentgui: Pull initial 017x translations from transifex (diff)
downloaddiscoin-cdf4089457856bdfe336b6f4b337d7e1ea4fdbd3.tar.xz
discoin-cdf4089457856bdfe336b6f4b337d7e1ea4fdbd3.zip
Remove redundant assignments (dead stores)
Diffstat (limited to 'src/bench')
-rw-r--r--src/bench/crypto_hash.cpp6
-rw-r--r--src/bench/rollingbloom.cpp3
2 files changed, 3 insertions, 6 deletions
diff --git a/src/bench/crypto_hash.cpp b/src/bench/crypto_hash.cpp
index 7d907eaf1..3ff106cb8 100644
--- a/src/bench/crypto_hash.cpp
+++ b/src/bench/crypto_hash.cpp
@@ -80,18 +80,16 @@ static void SipHash_32b(benchmark::State& state)
static void FastRandom_32bit(benchmark::State& state)
{
FastRandomContext rng(true);
- uint32_t x = 0;
while (state.KeepRunning()) {
- x += rng.rand32();
+ rng.rand32();
}
}
static void FastRandom_1bit(benchmark::State& state)
{
FastRandomContext rng(true);
- uint32_t x = 0;
while (state.KeepRunning()) {
- x += rng.randbool();
+ rng.randbool();
}
}
diff --git a/src/bench/rollingbloom.cpp b/src/bench/rollingbloom.cpp
index f7f72605d..f1363557f 100644
--- a/src/bench/rollingbloom.cpp
+++ b/src/bench/rollingbloom.cpp
@@ -12,7 +12,6 @@ static void RollingBloom(benchmark::State& state)
CRollingBloomFilter filter(120000, 0.000001);
std::vector<unsigned char> data(32);
uint32_t count = 0;
- uint64_t match = 0;
while (state.KeepRunning()) {
count++;
data[0] = count;
@@ -25,7 +24,7 @@ static void RollingBloom(benchmark::State& state)
data[1] = count >> 16;
data[2] = count >> 8;
data[3] = count;
- match += filter.contains(data);
+ filter.contains(data);
}
}