Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change splitTextIntoLines() to splitLines() #15972

Merged
merged 1 commit into from
Dec 31, 2023

Conversation

WalterBright
Copy link
Member

Cribbing code from std.string.splitLines():

  1. returns an InputRange rather than an array of lines
  2. no longer does any memory allocation (yay!)
  3. no more leaking memory
  4. stops processing the source text when the desired line is found
  5. supports Unicode line endings (fixing unnoticed benign bug)
  6. uses Voldemort return value
  7. is pure, @safe, @nogc and all that good stuff
  8. much faster
  9. completely self-contained

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#15972"

@WalterBright
Copy link
Member Author

Looks like our respite from test suite heisenbugs was, alas, too brief.

@WalterBright WalterBright merged commit 1747ae5 into dlang:master Dec 31, 2023
43 of 46 checks passed
@WalterBright WalterBright deleted the splitLines branch December 31, 2023 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants