diff --git a/lib/storage/index_db.go b/lib/storage/index_db.go index a28a8492f..2eee7b470 100644 --- a/lib/storage/index_db.go +++ b/lib/storage/index_db.go @@ -443,8 +443,8 @@ func marshalMetricIDs(dst []byte, metricIDs []uint64) []byte { var buf []byte sh := (*reflect.SliceHeader)(unsafe.Pointer(&buf)) sh.Data = uintptr(unsafe.Pointer(&metricIDs[0])) - sh.Cap = sh.Len - sh.Len = 8 * len(metricIDs) + sh.Cap = 8 * len(metricIDs) + sh.Len = sh.Cap dst = append(dst, buf...) return dst }