Procházet zdrojové kódy

Merge pull request #903 from LazyWolfLin:dev_random

PiperOrigin-RevId: 420532625
main
Victor Costan před 2 roky
rodič
revize
42cf899927
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. +1
    -1
      db/skiplist.h

+ 1
- 1
db/skiplist.h Zobrazit soubor

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

Načítá se…
Zrušit
Uložit