From 3806fbc23c6b4a84b2abe26bb650e1b3d059438f Mon Sep 17 00:00:00 2001 From: LazyWolfLin Date: Thu, 18 Feb 2021 11:04:10 +0800 Subject: Small fix. Use function instead of original expression. --- db/skiplist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/skiplist.h b/db/skiplist.h index a59b45b..f716834 100644 --- a/db/skiplist.h +++ b/db/skiplist.h @@ -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); -- cgit v1.2.1