From 74c563f94e4b02779465ead2b2dbce0db59e352a Mon Sep 17 00:00:00 2001 From: KunoiSayami Date: Thu, 17 Feb 2022 14:11:18 +0800 Subject: merge: Merge remote-tracking branch google/main@4fb1468 Signed-off-by: KunoiSayami --- db/skiplist.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'db/skiplist.h') diff --git a/db/skiplist.h b/db/skiplist.h index a59b45b..1140e59 100644 --- a/db/skiplist.h +++ b/db/skiplist.h @@ -36,8 +36,6 @@ namespace leveldb { -class Arena; - template class SkipList { private: @@ -243,7 +241,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); -- cgit v1.3.1