Skip to content

pp_reverse: Use isUTF8_CHAR() for validity check #23604

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

Open
wants to merge 1 commit into
base: blead
Choose a base branch
from

Conversation

khwilliamson
Copy link
Contributor

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,

  • This set of changes does not require a perldelta entry.

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,
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.

1 participant