Skip to content

Commit a63b80c

Browse files
committed
take care of uint variable length
1 parent 8ada166 commit a63b80c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

uhamt.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ func popCount(i *big.Int) int {
2929
}
3030

3131
func (n *Node) indexForBitPos(bp int) int {
32-
var x uint64
32+
var x uint
3333
var count, i int
3434
w := n.Bitfield.Bits()
35-
for x = uint64(bp); x > 64 && i < len(w); x -= 64 {
35+
for x = uint(bp); x > bits.UintSize && i < len(w); x -= bits.UintSize {
3636
count += bits.OnesCount64(uint64(w[i]))
3737
i++
3838
}

0 commit comments

Comments
 (0)