mirror of
https://github.com/HDT3213/godis.git
synced 2025-10-05 16:57:06 +08:00
bugfix:convert the range of k from [1,17] to [1,16]
This commit is contained in:
@@ -58,7 +58,7 @@ func makeSkiplist() *skiplist {
|
||||
func randomLevel() int16 {
|
||||
total := uint64(1)<<uint64(maxLevel) - 1
|
||||
k := rand.Uint64() % total
|
||||
return maxLevel - int16(bits.Len64(k)) + 1
|
||||
return maxLevel - int16(bits.Len64(k+1)) + 1
|
||||
}
|
||||
|
||||
func (skiplist *skiplist) insert(member string, score float64) *node {
|
||||
|
Reference in New Issue
Block a user