Explorar el Código

Merge pull request #903 from LazyWolfLin:dev_random

PiperOrigin-RevId: 420532625
xry
Victor Costan hace 2 años
padre
commit
42cf899927
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. +1
    -1
      db/skiplist.h

+ 1
- 1
db/skiplist.h Ver fichero

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

Cargando…
Cancelar
Guardar