Skip to content

refactor: replace Split in loops with more efficient SplitSeq#26429

Open
cuoguojida wants to merge 1 commit into
cosmos:mainfrom
cuoguojida:main
Open

refactor: replace Split in loops with more efficient SplitSeq#26429
cuoguojida wants to merge 1 commit into
cosmos:mainfrom
cuoguojida:main

Conversation

@cuoguojida
Copy link
Copy Markdown

Description

Closes: #XXXX

strings.SplitSeq (introduced in Go 1.23) returns a lazy sequence (strings.Seq), allowing gopher to iterate over tokens one by one without creating an intermediate slice.

It significantly reduces memory allocations and can improve performance for long strings.

More info: golang/go#61901

Signed-off-by: cuoguojida <cuoguojida@outlook.com>
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 16, 2026

PR author is not in the allowed authors list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant