From 0eeba93c4f91e659a470c064d36a9c221c24f348 Mon Sep 17 00:00:00 2001 From: Martin Helmich Date: Sat, 20 Nov 2021 13:26:21 +0100 Subject: [PATCH] Use "copy()" instead of loop (#222) --- main.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/main.go b/main.go index ae0b1f6..2def9e5 100644 --- a/main.go +++ b/main.go @@ -367,9 +367,7 @@ func processSource(nsCfg config.NamespaceConfig, t tail.Follower, parser parser. relabelLabelOffset := len(staticLabelValues) labelValues := make([]string, totalLabelCount) - for i := range staticLabelValues { - labelValues[i] = staticLabelValues[i] - } + copy(labelValues, staticLabelValues) for line := range t.Lines() { if nsCfg.PrintLog {