aboutsummaryrefslogtreecommitdiff
path: root/db/skiplist.h
diff options
context:
space:
mode:
authorKunoiSayami <[email protected]>2022-02-17 14:11:18 +0800
committerKunoiSayami <[email protected]>2022-02-17 14:11:18 +0800
commit74c563f94e4b02779465ead2b2dbce0db59e352a (patch)
tree64e747bfa7b46274a34b6c7787a7233ceafba846 /db/skiplist.h
parente98fc6bf301bb3bf38aab4ccce51edc16953024b (diff)
merge: Merge remote-tracking branch google/main@4fb1468
Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'db/skiplist.h')
-rw-r--r--db/skiplist.h4
1 files changed, 1 insertions, 3 deletions
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 <typename Key, class Comparator>
class SkipList {
private:
@@ -243,7 +241,7 @@ int SkipList<Key, Comparator>::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);