From 74dea05a310fbafa0b0cd732b940f5a35079919a Mon Sep 17 00:00:00 2001 From: baycore <45189032+dxasu@users.noreply.github.com> Date: Fri, 8 Aug 2025 10:40:23 +0800 Subject: [PATCH] Update memory.go --- memory.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/memory.go b/memory.go index f287829c..376a1e9d 100644 --- a/memory.go +++ b/memory.go @@ -52,10 +52,13 @@ func (mr *MemoryRow) growCellsSlice(newSize int) { newCap = newSize } capacity = newCap + newSlice := make([]*Cell, newSize, capacity) + copy(newSlice, mr.cells) + mr.cells = newSlice + } else { + mr.cells = mr.cells[:newSize] // no need make and copy } - newSlice := make([]*Cell, newSize, capacity) - copy(newSlice, mr.cells) - mr.cells = newSlice + } func (mr *MemoryRow) GetCell(colIdx int) *Cell {