Skip to content

Commit 6f39ffc

Browse files
author
Alexander Campbell
authored
Merge pull request #149 from jxguan/patch-1
Fix the bug where the capacity is incorrectly calculated.
2 parents caa9d0b + c7e48fc commit 6f39ffc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bitarray/sparse_bitarray.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func (sba *sparseBitArray) Capacity() uint64 {
179179
return 0
180180
}
181181

182-
return sba.indices[len(sba.indices)-1] + s
182+
return (sba.indices[len(sba.indices)-1] + 1) * s
183183
}
184184

185185
// Equals returns a bool indicating if the provided bit array

0 commit comments

Comments
 (0)