mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00: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
4cb83f0f4a
commit
057fb2120b
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue