lib/storage: reduce indentation in Storage.add

This commit is contained in:
Aliaksandr Valialkin 2020-05-14 23:23:39 +03:00
parent 71d29a8fa1
commit 1b5d272e07

View file

@ -1139,13 +1139,11 @@ func (s *Storage) add(rows []rawRow, mrs []MetricRow, precisionBits uint8) ([]ra
r.TSID = prevTSID r.TSID = prevTSID
continue continue
} }
if s.getTSIDFromCache(&r.TSID, mr.MetricNameRaw) { if s.getTSIDFromCache(&r.TSID, mr.MetricNameRaw) && !dmis.Has(r.TSID.MetricID) {
if !dmis.Has(r.TSID.MetricID) { // Fast path - the TSID for the given MetricName has been found in cache and isn't deleted.
// Fast path - the TSID for the given MetricName has been found in cache and isn't deleted. prevTSID = r.TSID
prevTSID = r.TSID prevMetricNameRaw = mr.MetricNameRaw
prevMetricNameRaw = mr.MetricNameRaw continue
continue
}
} }
// Slow path - the TSID is missing in the cache. Search for it in the index. // Slow path - the TSID is missing in the cache. Search for it in the index.