promql: Do not return nil slices to the pool

Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
beorn7 2023-04-05 14:31:05 +02:00
parent 817a2396cb
commit 551de0346f

View file

@ -1874,8 +1874,10 @@ func getFPointSlice(sz int) []FPoint {
}
func putFPointSlice(p []FPoint) {
if p != nil {
fPointPool.Put(p[:0])
}
}
func getHPointSlice(sz int) []HPoint {
if p := hPointPool.Get(); p != nil {
@ -1885,8 +1887,10 @@ func getHPointSlice(sz int) []HPoint {
}
func putHPointSlice(p []HPoint) {
if p != nil {
hPointPool.Put(p[:0])
}
}
// matrixSelector evaluates a *parser.MatrixSelector expression.
func (ev *evaluator) matrixSelector(node *parser.MatrixSelector) (Matrix, storage.Warnings) {