Skip to content

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

Open
purelualight wants to merge 1 commit intoXmirrorSecurity:masterfrom
purelualight:master
Open

refactor: replace Split in loops with more efficient SplitSeq#340
purelualight wants to merge 1 commit intoXmirrorSecurity:masterfrom
purelualight:master

Conversation

@purelualight
Copy link
Copy Markdown

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: purelualight <purelualight@outlook.com>
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