Merge pull request #11805 from juejinyuxitu/FieldsFuncSeq

refactor: use strings.FieldsFuncSeq to reduce memory allocations
This commit is contained in:
Babak K. Shandiz 2025-09-30 11:18:57 +01:00 committed by GitHub
commit 52ba836605
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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