瀏覽代碼

Merge pull request #903 from LazyWolfLin:dev_random

PiperOrigin-RevId: 420532625
master
Victor Costan 3 年之前
父節點
當前提交
42cf899927
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. +1
    -1
      db/skiplist.h

+ 1
- 1
db/skiplist.h 查看文件

@ -243,7 +243,7 @@ int SkipList::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);

Loading…
取消
儲存