Skip to content

Commit 8f3b8f3

Browse files
author
徐志强
committed
fix maxBucketSize
1 parent 88e3535 commit 8f3b8f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rank_pairing/rank_pairing_heap.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,11 @@ func merge(r0, r1 *RPHeap) *RPHeap {
285285

286286
func (r *RPHeap) maxBucketSize() int {
287287
bit, cnt := 1, r.size
288-
for cnt > 1 {
288+
for cnt > 2 {
289289
cnt /= 2
290290
bit++
291291
}
292-
return bit + 1
292+
return bit
293293
}
294294

295295
func (r *RPHeap) insertRoot(ptr *node) {

0 commit comments

Comments
 (0)