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
1 changed files with 4 additions and 0 deletions

View File

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