Skip to content

Conversation

@AZero13
Copy link
Contributor

@AZero13 AZero13 commented Dec 20, 2025

0x80 - 0xFF are invalid ascii, and thus, need to not return true always.

@AZero13 AZero13 requested a review from a team as a code owner December 20, 2025 04:13
0x80 - 0xFF are invalid ascii, and thus, need to not return true always.
@glessard
Copy link
Contributor

This function is an implementation detail of the function _UTFParser.parseScalar(from:), where the input is expected to have already been validated. It is used to implement a fast path where a single code unit from the input happens to be a whole scalar. For ASCII, this is always true, and we do not need to revalidate it. While there is no bug to fix here, in principle this change should be harmless. It is possible, however, that the change would slow things down a tiny bit. I would be interested in finding out if a misbehaviour caused by this function can be teased out?

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.

2 participants