Skip to content

Commit

Permalink
specify slice cap
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Melanchyk <[email protected]>
  • Loading branch information
arturmelanchyk committed Dec 23, 2024
1 parent 07f42ab commit 4598e71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/eval/countminsketch.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ func DeserializeCMS(buffer *bytes.Reader) (*CountMinSketch, error) {
matrix := make([][]uint64, depth)
flatMatrix := make([]uint64, depth*width) // single memory allocation
for i := 0; i < int(depth); i++ {
matrix[i] = flatMatrix[i*int(width) : (i+1)*int(width)]
matrix[i] = flatMatrix[i*int(width) : (i+1)*int(width) : (i+1)*int(width)]
for j := 0; j < int(width); j++ {
if err := binary.Read(buffer, binary.BigEndian, &matrix[i][j]); err != nil {
return nil, err
Expand Down

0 comments on commit 4598e71

Please sign in to comment.