index: fix blocklist size

This commit is contained in:
Michael Eischer 2023-06-02 19:39:12 +02:00
parent 9a7056a479
commit ac1dfc99bb
1 changed files with 3 additions and 3 deletions

View File

@ -204,14 +204,14 @@ func (h *hashedArrayTree) grow() {
idx, subIdx := h.index(h.size)
if int(idx) == len(h.blockList) {
// blockList is too small -> double list and block size
oldBlocks := h.blockList
h.blockList = make([][]indexEntry, h.blockSize)
h.blockSize *= 2
h.mask = h.mask*2 + 1
h.maskShift++
idx = idx / 2
oldBlocks := h.blockList
h.blockList = make([][]indexEntry, h.blockSize)
// pairwise merging of blocks
for i := 0; i < len(oldBlocks); i += 2 {
block := make([]indexEntry, 0, h.blockSize)