From d5050afd29e93122fa8a9b1e6c7494828ab0c9a5 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sat, 15 Jul 2017 22:24:06 +0200 Subject: [PATCH] Improve bench --- bench/max-dict.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bench/max-dict.c b/bench/max-dict.c index fd752658..a9990b91 100644 --- a/bench/max-dict.c +++ b/bench/max-dict.c @@ -26,6 +26,7 @@ #include #include +#define NDEBUG #include "m-dict.h" static inline bool oor_equal_p(int64_t k, unsigned char n) @@ -41,7 +42,11 @@ DICT_OA_DEF2(int64, int64_t, M_OPEXTEND(M_DEFAULT_OPLIST, OOR_EQUAL(oor_equal_p) static int64_t get_rand(void) { - return (rand() * RAND_MAX + rand()) * RAND_MAX + rand(); + int64_t n; + do { + n = (rand() * RAND_MAX + rand()) * RAND_MAX + rand(); + } while (n == -1 || n == -2); + return n; } // Let's push value into the dict until the system abandons!