app/vmselect/netstorage: protect from too smart compiler, which may break memory usage optimization in ProcessSearchQuery

This commit is contained in:
Aliaksandr Valialkin 2020-07-23 17:53:52 +03:00
parent 4c8b49b193
commit 461481fbdf

View file

@ -579,9 +579,8 @@ func ProcessSearchQuery(sq *storage.SearchQuery, fetchData bool, deadline Deadli
} else {
// An optimization for big number of time series with long metricName values:
// use only a single copy of metricName for both orderedMetricNames and m.
metricNameStr := string(metricName)
orderedMetricNames = append(orderedMetricNames, metricNameStr)
m[metricNameStr] = brs
orderedMetricNames = append(orderedMetricNames, string(metricName))
m[orderedMetricNames[len(orderedMetricNames)-1]] = brs
}
}
if err := sr.Error(); err != nil {