From f5cf156af117d004352914b6a6db079ee765880e Mon Sep 17 00:00:00 2001 From: juejinyuxitu Date: Wed, 24 Sep 2025 23:11:17 +0800 Subject: [PATCH] refactor: use strings.FieldsFuncSeq to reduce memory allocations Signed-off-by: juejinyuxitu --- pkg/cmd/gist/list/list.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/gist/list/list.go b/pkg/cmd/gist/list/list.go index a4fd245f6..9dd2bfba5 100644 --- a/pkg/cmd/gist/list/list.go +++ b/pkg/cmd/gist/list/list.go @@ -250,7 +250,7 @@ func printContent(io *iostreams.IOStreams, gists []shared.Gist, filter *regexp.R } if file.Content != "" { - for _, line := range strings.FieldsFunc(file.Content, split) { + for line := range strings.FieldsFuncSeq(file.Content, split) { if filter.MatchString(line) { if line, err = highlightMatch(line, filter, &matched, normal, cs.Highlight); err != nil { return err