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

Drop Char::Reader#@end #13920

Conversation

straight-shoota
Copy link
Member

This is a follow-up to #13817 which removed one of the two places that read the value of Char::Reader#@end. It was replaced by a comparison @pos < @string.bytesize. This expression is always quivalent to @end, so it's entirely redundant.
This patch removes the remaining use in #has_next? and removes the instance variable entirely.
Additionaly, the implementation of #each switches back to use #has_next? as it was before #13817.

See also #13816 for some prior discussion.

@straight-shoota straight-shoota added this to the 1.11.0 milestone Oct 31, 2023
@straight-shoota straight-shoota merged commit f304b57 into crystal-lang:master Nov 1, 2023
@straight-shoota straight-shoota deleted the refactor/char_reader-drop-end branch November 1, 2023 19:21
Blacksmoke16 pushed a commit to Blacksmoke16/crystal that referenced this pull request Dec 11, 2023
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.

2 participants