mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
promql: Do not return nil slices to the pool
Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
parent
817a2396cb
commit
551de0346f
|
@ -1874,7 +1874,9 @@ func getFPointSlice(sz int) []FPoint {
|
|||
}
|
||||
|
||||
func putFPointSlice(p []FPoint) {
|
||||
fPointPool.Put(p[:0])
|
||||
if p != nil {
|
||||
fPointPool.Put(p[:0])
|
||||
}
|
||||
}
|
||||
|
||||
func getHPointSlice(sz int) []HPoint {
|
||||
|
@ -1885,7 +1887,9 @@ func getHPointSlice(sz int) []HPoint {
|
|||
}
|
||||
|
||||
func putHPointSlice(p []HPoint) {
|
||||
hPointPool.Put(p[:0])
|
||||
if p != nil {
|
||||
hPointPool.Put(p[:0])
|
||||
}
|
||||
}
|
||||
|
||||
// matrixSelector evaluates a *parser.MatrixSelector expression.
|
||||
|
|
Loading…
Reference in a new issue