Przeglądaj źródła

Small fix.

Use function instead of original expression.
main
LazyWolfLin 3 lat temu
rodzic
commit
3806fbc23c
1 zmienionych plików z 1 dodań i 1 usunięć
  1. +1
    -1
      db/skiplist.h

+ 1
- 1
db/skiplist.h Wyświetl plik

@ -243,7 +243,7 @@ int SkipList::RandomHeight() {
// Increase height with probability 1 in kBranching // Increase height with probability 1 in kBranching
static const unsigned int kBranching = 4; static const unsigned int kBranching = 4;
int height = 1; int height = 1;
while (height < kMaxHeight && ((rnd_.Next() % kBranching) == 0)) {
while (height < kMaxHeight && rnd_.OneIn(kBranching)) {
height++; height++;
} }
assert(height > 0); assert(height > 0);

Ładowanie…
Anuluj
Zapisz