mirror of
https://github.com/trapexit/mergerfs.git
synced 2026-10-26 19:01:56 -04:00
Use RND class for shrink_to_rand_elem and add assertions
This commit is contained in:
parent
4665ac73dc
commit
572139bc62
2 changed files with 6 additions and 6 deletions
|
|
@ -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_)));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue