Skip to content

Commit f3f0e7e

Browse files
committed
is_utf8_common: Use utf8_to_uv_or_die
Replace this longer code by this newer function which encapsulates the functionality in one line.
1 parent ba4bfb0 commit f3f0e7e

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

utf8.c

+1-7
Original file line numberDiff line numberDiff line change
@@ -3858,13 +3858,7 @@ S_is_utf8_common(pTHX_ const U8 *const p, const U8 * const e,
38583858
* starts at <p>, and extending no further than <e - 1> is in the inversion
38593859
* list <invlist>. */
38603860

3861-
UV cp = utf8n_to_uvchr(p, e - p, NULL, 0);
3862-
3863-
if (cp == 0 && (p >= e || *p != '\0')) {
3864-
force_out_malformed_utf8_message_(p, e, 0, MALFORMED_UTF8_DIE);
3865-
NOT_REACHED; /* NOTREACHED */
3866-
}
3867-
3861+
UV cp = utf8_to_uv_or_die(p, e, NULL);
38683862
return _invlist_contains_cp(invlist, cp);
38693863
}
38703864

0 commit comments

Comments
 (0)