mirror of
https://github.com/prometheus/prometheus
synced 2025-01-13 10:22:46 +00:00
Don't allocate a mergeSeries if there is only one series to merge.
This commit is contained in:
parent
8a01a0fbed
commit
48e39068bd
@ -340,6 +340,9 @@ func (c *mergeSeriesSet) Next() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *mergeSeriesSet) At() Series {
|
func (c *mergeSeriesSet) At() Series {
|
||||||
|
if len(c.currentSets) == 1 {
|
||||||
|
return c.currentSets[0].At()
|
||||||
|
}
|
||||||
series := []Series{}
|
series := []Series{}
|
||||||
for _, seriesSet := range c.currentSets {
|
for _, seriesSet := range c.currentSets {
|
||||||
series = append(series, seriesSet.At())
|
series = append(series, seriesSet.At())
|
||||||
|
Loading…
Reference in New Issue
Block a user