瀏覽代碼

Merge pull request #903 from LazyWolfLin:dev_random

PiperOrigin-RevId: 420532625
main
Victor Costan 2 年之前
父節點
當前提交
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…
取消
儲存