Repository navigation
fix std.Io.Reader delimiter functions - #25162
Closed
truly-not-taken wants to merge 11 commits into
Closed
truly-not-taken wants to merge 11 commits into
truly-not-taken wants to merge 11 commits into
Conversation
these would catch the problems that takeDelimiter had, if those problems were present in the other functions (they weren't)
… take_delimiter_exclusive
andrewrk
added a commit
that referenced
this pull request
Oct 9, 2025
Now it's based on calling fillMore rather than an illegal aliased stream into the Reader buffer. This commit also includes a disambiguation block inspired by #25162. If `StreamTooLong` was added to `RebaseError` then this logic could be replaced by removing the exit condition from the while loop. That error code would represent when `buffer` capacity is too small for an operation, replacing the current use of asserts.
Member
|
Nice, that's a decent strategy. I made some changes inspired by this in #25512. After that lands, the next step will be to rebase this and check in on the status of issues and added unit tests. |
andrewrk
added a commit
that referenced
this pull request
Oct 9, 2025
Now it's based on calling fillMore rather than an illegal aliased stream into the Reader buffer. This commit also includes a disambiguation block inspired by #25162. If `StreamTooLong` was added to `RebaseError` then this logic could be replaced by removing the exit condition from the while loop. That error code would represent when `buffer` capacity is too small for an operation, replacing the current use of asserts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I finally feel good about this fix. No more hacks or tricks. Just call stream() one more time to detect end of stream in fixed Reader.
The performance should not suffer. Normal reading from a file line by line only triggers this if the buffer is shorter than the line. This should be a rare condition.
fixes #24950
fixes #25132