Small fix.

Use function instead of original expression.
This commit is contained in:
LazyWolfLin 2021-02-18 11:04:10 +08:00
parent f57513a1d6
commit 3806fbc23c

View File

@ -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);