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

io.string_reader: fix needs_fill_until check #21005

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

daddycocoaman
Copy link
Contributor

@daddycocoaman daddycocoaman commented Mar 12, 2024

This PR is meant to address #20998.

It changes the condition so that if you request the last byte individually, then StringReader won't fail when the current offset is equal to the length of the builder before it increases the offset to EOF.

@daddycocoaman
Copy link
Contributor Author

In my mind, the builder length should only be increased if

  • the offset is at EOF and you need to get space from that point
  • the offset is before EOF and you need get additional space past EOF

Maybe @Casper64 can add input as module creator.

@spytheman spytheman requested a review from Casper64 March 13, 2024 11:53
Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me, the change is logical. @Casper64 what do you think?

@Casper64
Copy link
Member

Yeah this is better

@spytheman spytheman merged commit 54da256 into vlang:master Mar 13, 2024
42 checks passed
@daddycocoaman daddycocoaman changed the title fix needs_fill_until check io.string_reader: fix needs_fill_until check Mar 13, 2024
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