Merge pull request #11805 from juejinyuxitu/FieldsFuncSeq
refactor: use strings.FieldsFuncSeq to reduce memory allocations
This commit is contained in:
commit
52ba836605
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue