diff options
author | Victor Costan <pwnall@chromium.org> | 2022-01-09 03:15:22 +0000 |
---|---|---|
committer | Victor Costan <pwnall@chromium.org> | 2022-01-09 03:15:22 +0000 |
commit | 42cf89992724487f8bf08f17804de38921f973c6 (patch) | |
tree | 42997b75ae822e1b06f8ec0b7d12f97529815261 | |
parent | 8796c44772e63eafe916921cf8f5fa940f53106b (diff) | |
parent | 3806fbc23c6b4a84b2abe26bb650e1b3d059438f (diff) | |
download | leveldb-42cf89992724487f8bf08f17804de38921f973c6.tar.gz |
Merge pull request #903 from LazyWolfLin:dev_random
PiperOrigin-RevId: 420532625
-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); |