Don't allocate a mergeSeries if there is only one series to merge.

pull/3736/head
Tom Wilkie 2018-01-25 11:11:55 +00:00
parent 8a01a0fbed
commit 48e39068bd
1 changed files with 3 additions and 0 deletions

View File

@ -340,6 +340,9 @@ func (c *mergeSeriesSet) Next() bool {
}
func (c *mergeSeriesSet) At() Series {
if len(c.currentSets) == 1 {
return c.currentSets[0].At()
}
series := []Series{}
for _, seriesSet := range c.currentSets {
series = append(series, seriesSet.At())