Use RND class for shrink_to_rand_elem and add assertions

This commit is contained in:
Antonio SJ Musumeci 2026-03-10 07:36:04 -05:00
parent 4665ac73dc
commit 572139bc62
2 changed files with 6 additions and 6 deletions

View file

@ -20,6 +20,8 @@
#include "rapidhash/rapidhash.h"
#include <cassert>
#include <sys/time.h>
@ -57,6 +59,7 @@ RND::rand64(void)
u64
RND::rand64(cu64 max_)
{
assert(max_ > 0);
return (RND::rand64() % max_);
}
@ -64,5 +67,6 @@ u64
RND::rand64(cu64 min_,
cu64 max_)
{
assert(max_ > min_);
return (min_ + (RND::rand64() % (max_ - min_)));
}