We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f74b7e2 commit cf6a989Copy full SHA for cf6a989
src/bench.cpp
@@ -6,6 +6,7 @@
6
7
#include "../include/minisketch.h"
8
#include <string.h>
9
+#include <limits>
10
#include <memory>
11
#include <vector>
12
#include <chrono>
@@ -42,7 +43,13 @@ int main(int argc, char** argv) {
42
43
std::vector<minisketch*> states;
44
std::vector<uint64_t> roots(2 * syndromes);
45
std::random_device rng;
- std::uniform_int_distribution<uint64_t> dist(1, (uint64_t(1) << bits) - 1);
46
+ uint64_t upper_bound;
47
+ if (bits < 64) {
48
+ upper_bound = (uint64_t(1) << bits) - 1;
49
+ } else {
50
+ upper_bound = std::numeric_limits<uint64_t>::max();
51
+ }
52
+ std::uniform_int_distribution<uint64_t> dist(1, upper_bound);
53
states.resize(iters);
54
std::vector<double> benches;
55
benches.reserve(iters);
0 commit comments