From 88bf1ab5ec1e87450346ba12a20e2e8f26b18ce5 Mon Sep 17 00:00:00 2001 From: Vivek V Date: Tue, 15 Oct 2019 00:33:46 +0530 Subject: [PATCH] Added capacity to slice creation, when capacity is known --- widgets.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets.go b/widgets.go index a901373..9172f35 100644 --- a/widgets.go +++ b/widgets.go @@ -67,7 +67,7 @@ func (w *widgets) SetState(s string) { } func (w *widgets) SetTrace(a []string) { - var lines []string + lines := make([]string, 0, len(a)) for _, s := range a { lines = append(lines, strings.Replace(s, "\t", " ", -1)) }