Skip to content

Commit 1193ca1

Browse files
committed
Remove unnecessary alloc
1 parent 447df97 commit 1193ca1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

go/store/nbs/table_reader.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -843,9 +843,7 @@ func (tr tableReader) iterateAllChunks(ctx context.Context, cb func(chunk chunks
843843
}
844844

845845
bufferOffset := chunk.offset - blockStart
846-
chunkData := make([]byte, chunk.length)
847-
copy(chunkData, dataBlock[bufferOffset:bufferOffset+uint64(chunk.length)])
848-
cchk, err := NewCompressedChunk(chunk.hash, chunkData)
846+
cchk, err := NewCompressedChunk(chunk.hash, dataBlock[bufferOffset:bufferOffset+uint64(chunk.length)])
849847
if err != nil {
850848
return err
851849
}

0 commit comments

Comments
 (0)