pp_reverse: Use isUTF8_CHAR() for validity check #23604
Open
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.
The code was converting a UTF-8 single character string to its code point, just to find out if the string was wellformed or not. It had no need of the returned code point. It is more efficient to just use the function that checks for validity without trying to get the code point.
The validity checking function returns 0 on failure; else how many bytes were in the string. Use this value instead of calling UTF8SKIP to re-derive it.
And the former function utf8_to_uvchr_buf() is discouraged from use anyway. This commit removes the final core use of the discouraged _uvchr functions,