Skip to content

Commit fff9141

Browse files
phyBracketsfanquake
authored andcommitted
refactor: Remove deduplication of data in rollingbloom bench
1 parent d906329 commit fff9141

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/bench/rollingbloom.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
#include <bench/bench.h>
77
#include <common/bloom.h>
8+
#include <crypto/common.h>
9+
10+
#include <vector>
811

912
static void RollingBloom(benchmark::Bench& bench)
1013
{
@@ -13,16 +16,10 @@ static void RollingBloom(benchmark::Bench& bench)
1316
uint32_t count = 0;
1417
bench.run([&] {
1518
count++;
16-
data[0] = count & 0xFF;
17-
data[1] = (count >> 8) & 0xFF;
18-
data[2] = (count >> 16) & 0xFF;
19-
data[3] = (count >> 24) & 0xFF;
19+
WriteLE32(data.data(), count);
2020
filter.insert(data);
2121

22-
data[0] = (count >> 24) & 0xFF;
23-
data[1] = (count >> 16) & 0xFF;
24-
data[2] = (count >> 8) & 0xFF;
25-
data[3] = count & 0xFF;
22+
WriteBE32(data.data(), count);
2623
filter.contains(data);
2724
});
2825
}

0 commit comments

Comments
 (0)