From e52c69287716cae8ee806e33c1ed74e362289317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=BF=97=E5=BC=BA?= Date: Sat, 21 Dec 2019 20:56:27 +0800 Subject: [PATCH] fix maxBucketSize --- rank_pairing/rank_pairing_heap.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rank_pairing/rank_pairing_heap.go b/rank_pairing/rank_pairing_heap.go index d399116..eb5c617 100644 --- a/rank_pairing/rank_pairing_heap.go +++ b/rank_pairing/rank_pairing_heap.go @@ -284,7 +284,7 @@ func merge(r0, r1 *RPHeap) *RPHeap { } func (r *RPHeap) maxBucketSize() int { - bit, cnt := 1, r.size + bit, cnt := 0, r.size for cnt > 1 { cnt /= 2 bit++