Skip to content

Commit

Permalink
[chore] preallocate slice (#24951)
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme authored Aug 7, 2023
1 parent 1c00b6e commit 46849dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/translator/prometheusremotewrite/testutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 46849dd

Please sign in to comment.