From 46849dd08c33b21cf4fa4672091e18cdccd8529e Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Mon, 7 Aug 2023 06:39:04 -0700 Subject: [PATCH] [chore] preallocate slice (#24951) --- pkg/translator/prometheusremotewrite/testutils_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/translator/prometheusremotewrite/testutils_test.go b/pkg/translator/prometheusremotewrite/testutils_test.go index f130e6349c70..bdc6fa594648 100644 --- a/pkg/translator/prometheusremotewrite/testutils_test.go +++ b/pkg/translator/prometheusremotewrite/testutils_test.go @@ -302,10 +302,10 @@ func getSummaryMetric(name string, attributes pcommon.Map, ts uint64, sum float6 } func getBucketBoundsData(values []float64) []bucketBoundsData { - var b []bucketBoundsData + b := make([]bucketBoundsData, len(values)) - for _, value := range values { - b = append(b, bucketBoundsData{sig: lb1Sig, bound: value}) + for i, value := range values { + b[i] = bucketBoundsData{sig: lb1Sig, bound: value} } return b