From 8c8d16e98314b042d04192f33426ea602ca1af45 Mon Sep 17 00:00:00 2001 From: Marcel Meyer Date: Thu, 13 Jun 2024 21:11:58 +0200 Subject: [PATCH] Replace append with array index assignment --- annot.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/annot.go b/annot.go index 1e7249c..72bd250 100644 --- a/annot.go +++ b/annot.go @@ -110,7 +110,8 @@ func Write(w io.Writer, annots ...*Annot) error { for _, a := range annots { if len(a.Lines) == 0 { - a.lines = append(a.lines, &line{}) + a.lines = make([]*line, 1) + a.lines[0] = &line{} continue } a.lines = make([]*line, len(a.Lines))