Return unused point slice to pool in Call and VectorSelector eval. (#6427)

Signed-off-by: Mark Nevill <mark.nevill@gmail.com>
This commit is contained in:
Mark Nevill 2019-12-09 10:32:40 +00:00 committed by Brian Brazil
parent c0250cf120
commit b0a5c51b95

View file

@ -1070,6 +1070,8 @@ func (ev *evaluator) eval(expr Expr) Value {
} else { } else {
ev.error(ErrTooManySamples(env)) ev.error(ErrTooManySamples(env))
} }
} else {
putPointSlice(ss.Points)
} }
} }
if mat.ContainsSameLabelset() { if mat.ContainsSameLabelset() {
@ -1165,6 +1167,8 @@ func (ev *evaluator) eval(expr Expr) Value {
if len(ss.Points) > 0 { if len(ss.Points) > 0 {
mat = append(mat, ss) mat = append(mat, ss)
} else {
putPointSlice(ss.Points)
} }
} }