From b11062bfccc9c8b2f7827aa2dc611b005025ad40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sat, 4 Jun 2022 04:15:02 +0100 Subject: [PATCH] Don't count added labels when initializing slice (#10756) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was added in #10749 but based on feedback it might be over-allocating so worth removing. Signed-off-by: Ɓukasz Mierzwa --- model/labels/labels.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/labels/labels.go b/model/labels/labels.go index af321a37c..29b7385c8 100644 --- a/model/labels/labels.go +++ b/model/labels/labels.go @@ -452,7 +452,7 @@ func (b *Builder) Labels() Labels { // In the general case, labels are removed, modified or moved // rather than added. - res := make(Labels, 0, len(b.base)+len(b.add)) + res := make(Labels, 0, len(b.base)) Outer: for _, l := range b.base { for _, n := range b.del {