PromQL: reduce garbage in range-query evaluation

The temporary variable was allocated on the heap, and it is unnecessary.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
Bryan Boreham 2023-10-22 12:38:23 +00:00
parent 05356e76de
commit 49c5e7afe1

View File

@ -1172,9 +1172,7 @@ func (ev *evaluator) rangeEval(prepSeries func(labels.Labels, *EvalSeriesHelper)
bufHelpers[i] = make([]EvalSeriesHelper, len(matrixes[i]))
for si, series := range matrixes[i] {
h := seriesHelpers[i][si]
prepSeries(series.Metric, &h)
seriesHelpers[i][si] = h
prepSeries(series.Metric, &seriesHelpers[i][si])
}
}
}