From 1b5d272e0798b3f536cf9c67b81e506a5adea56b Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Thu, 14 May 2020 23:23:39 +0300 Subject: [PATCH] lib/storage: reduce indentation in Storage.add --- lib/storage/storage.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/storage/storage.go b/lib/storage/storage.go index 74001435b..474bc9140 100644 --- a/lib/storage/storage.go +++ b/lib/storage/storage.go @@ -1139,13 +1139,11 @@ func (s *Storage) add(rows []rawRow, mrs []MetricRow, precisionBits uint8) ([]ra r.TSID = prevTSID continue } - if s.getTSIDFromCache(&r.TSID, mr.MetricNameRaw) { - if !dmis.Has(r.TSID.MetricID) { - // Fast path - the TSID for the given MetricName has been found in cache and isn't deleted. - prevTSID = r.TSID - prevMetricNameRaw = mr.MetricNameRaw - continue - } + if s.getTSIDFromCache(&r.TSID, mr.MetricNameRaw) && !dmis.Has(r.TSID.MetricID) { + // Fast path - the TSID for the given MetricName has been found in cache and isn't deleted. + prevTSID = r.TSID + prevMetricNameRaw = mr.MetricNameRaw + continue } // Slow path - the TSID is missing in the cache. Search for it in the index.