From 1a5813b58078f75bc5bb7d2dc158f9e759269aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Wed, 25 Mar 2020 21:55:54 +0000 Subject: [PATCH] fix(backend): remove unnecessary guard around map access --- cmd/karma/alerts.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmd/karma/alerts.go b/cmd/karma/alerts.go index 4e79991db..f16999402 100644 --- a/cmd/karma/alerts.go +++ b/cmd/karma/alerts.go @@ -35,11 +35,7 @@ func countLabel(countStore map[string]map[string]int, key string, val string) { if _, found := countStore[key]; !found { countStore[key] = make(map[string]int) } - if _, found := countStore[key][val]; found { - countStore[key][val]++ - } else { - countStore[key][val] = 1 - } + countStore[key][val]++ } func countersToLabelStats(counters map[string]map[string]int) models.LabelNameStatsList {