From 096b6b46d42523beffbf4e9146c2a78865707e6c Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Thu, 28 Oct 2021 00:21:11 +0700 Subject: [PATCH] refactor: micro optimization --- asciitxt.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/asciitxt.go b/asciitxt.go index 15a9ad4..cb1f6d2 100644 --- a/asciitxt.go +++ b/asciitxt.go @@ -49,16 +49,16 @@ func WithConfig(txt string, config Config) string { arr = append(arr, temp) } - var output string + var output strings.Builder for k := 0; k < llen; k++ { for l := 0; l < len(arr); l++ { - output += arr[l][k] + output.WriteString(arr[l][k]) } - output += "\n" + output.WriteString("\n") } - return output + return output.String() } //