mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 16:30:55 +01:00
lib/storage: properly set buf capacity inside marshalMetricID
Previously it was always set to 0. In theory this could result into incorrect marshaling
of metricIDs.
The issue has been introduced in 5e4dfe50c6
This commit is contained in:
parent
2fad03d85e
commit
512c73cef9
@ -456,8 +456,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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user