Skip to content

Commit 26a2bc8

Browse files
committed
is_utf8_common: Use utf8_to_uv_or_die()
This avoids duplicating code
1 parent d193361 commit 26a2bc8

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

utf8.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3850,13 +3850,7 @@ S_is_utf8_common(pTHX_ const U8 *const p, const U8 * const e,
38503850
* starts at <p>, and extending no further than <e - 1> is in the inversion
38513851
* list <invlist>. */
38523852

3853-
UV cp = utf8n_to_uvchr(p, e - p, NULL, 0);
3854-
3855-
if (cp == 0 && (p >= e || *p != '\0')) {
3856-
force_out_malformed_utf8_message_(p, e, 0, MALFORMED_UTF8_DIE);
3857-
NOT_REACHED; /* NOTREACHED */
3858-
}
3859-
3853+
UV cp = utf8_to_uv_or_die(p, e, NULL);
38603854
return _invlist_contains_cp(invlist, cp);
38613855
}
38623856

0 commit comments

Comments
 (0)