diff options
-rw-r--r-- | db/skiplist.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/db/skiplist.h b/db/skiplist.h index a59b45b..f716834 100644 --- a/db/skiplist.h +++ b/db/skiplist.h @@ -243,7 +243,7 @@ int SkipList<Key, Comparator>::RandomHeight() { // Increase height with probability 1 in kBranching static const unsigned int kBranching = 4; int height = 1; - while (height < kMaxHeight && ((rnd_.Next() % kBranching) == 0)) { + while (height < kMaxHeight && rnd_.OneIn(kBranching)) { height++; } assert(height > 0); |