From f0ec81baddf34cfb2c466816afed6764b52a8b67 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Sun, 20 Feb 2022 20:44:25 +0000 Subject: [PATCH] Update package tsdb/test for new labels.Labels type Signed-off-by: Bryan Boreham --- tsdb/test/labels_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tsdb/test/labels_test.go b/tsdb/test/labels_test.go index 354dbf836..f1ec34f3a 100644 --- a/tsdb/test/labels_test.go +++ b/tsdb/test/labels_test.go @@ -58,9 +58,7 @@ func BenchmarkLabelsClone(b *testing.B) { l := labels.FromMap(m) for i := 0; i < b.N; i++ { - res := make(labels.Labels, len(l)) - copy(res, l) - l = res + l = l.Copy() } } @@ -106,13 +104,13 @@ func BenchmarkLabelSetAccess(b *testing.B) { var v string - for _, l := range ls { + ls.Range(func(l labels.Label) { b.Run(l.Name, func(b *testing.B) { for i := 0; i < b.N; i++ { v = ls.Get(l.Name) } }) - } + }) _ = v }