Skip to content

Conversation

@asttool
Copy link

@asttool asttool commented Oct 15, 2025

What type of PR is this?

Other

What does this PR do? Why is it needed?

Optimize code using a more modern writing style which can make the code more efficient and cleaner.

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

Which issues(s) does this PR fix?

Fixes #

Other notes for review

Acknowledgements

Signed-off-by: asttool <asttool@outlook.com>
@CLAassistant
Copy link

CLAassistant commented Oct 15, 2025

CLA assistant check
All committers have signed the CLA.

@asttool
Copy link
Author

asttool commented Oct 28, 2025

@rkapka @terencechain Hi, Could you please review this PR at your convenience? Thank you very much.

@prestonvanloon
Copy link
Member

We use strings.Split in 87 places. Could this be applied to all areas of the application or is there a reason to only change these three instances?

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.

3 participants