From ac1dfc99bb01205dab5d99abcea8c58e3439975e Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Fri, 2 Jun 2023 19:39:12 +0200 Subject: [PATCH] index: fix blocklist size --- internal/index/indexmap.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/index/indexmap.go b/internal/index/indexmap.go index c709f7b3a..b779b0527 100644 --- a/internal/index/indexmap.go +++ b/internal/index/indexmap.go @@ -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)