@@ -3880,20 +3880,6 @@ Perl__to_uni_fold_flags(pTHX_ UV c, U8* p, STRLEN *lenp, U8 flags)
38803880 }
38813881}
38823882
3883- PERL_STATIC_INLINE bool
3884- S_is_utf8_common (pTHX_ const U8 * const p , const U8 * const e ,
3885- SV * const invlist )
3886- {
3887- PERL_ARGS_ASSERT_IS_UTF8_COMMON ;
3888-
3889- /* returns a boolean giving whether or not the UTF8-encoded character that
3890- * starts at <p>, and extending no further than <e - 1> is in the inversion
3891- * list <invlist>. */
3892-
3893- UV cp = utf8_to_uv_or_die (p , e , NULL );
3894- return _invlist_contains_cp (invlist , cp );
3895- }
3896-
38973883#if 0 /* Not currently used, but may be needed in the future */
38983884PERLVAR (I , seen_deprecated_macro , HV * )
38993885
@@ -3941,28 +3927,34 @@ S_warn_on_first_deprecated_use(pTHX_ U32 category,
39413927}
39423928#endif
39433929
3930+ /* returns a boolean giving whether or not the UTF8-encoded character that
3931+ * starts at <p>, and extending no further than <e - 1> is in the inversion
3932+ * list <invlist>. */
3933+ #define IS_UTF8_IN_INVLIST (p , e , invlist ) \
3934+ _invlist_contains_cp(invlist, utf8_to_uv_or_die(p, e, NULL))
3935+
39443936bool
39453937Perl__is_utf8_FOO (pTHX_ const U8 classnum , const U8 * p , const U8 * const e )
39463938{
39473939 PERL_ARGS_ASSERT__IS_UTF8_FOO ;
39483940
3949- return is_utf8_common (p , e , PL_XPosix_ptrs [classnum ]);
3941+ return IS_UTF8_IN_INVLIST (p , e , PL_XPosix_ptrs [classnum ]);
39503942}
39513943
39523944bool
39533945Perl__is_utf8_perl_idstart (pTHX_ const U8 * p , const U8 * const e )
39543946{
39553947 PERL_ARGS_ASSERT__IS_UTF8_PERL_IDSTART ;
39563948
3957- return is_utf8_common (p , e , PL_utf8_perl_idstart );
3949+ return IS_UTF8_IN_INVLIST (p , e , PL_utf8_perl_idstart );
39583950}
39593951
39603952bool
39613953Perl__is_utf8_perl_idcont (pTHX_ const U8 * p , const U8 * const e )
39623954{
39633955 PERL_ARGS_ASSERT__IS_UTF8_PERL_IDCONT ;
39643956
3965- return is_utf8_common (p , e , PL_utf8_perl_idcont );
3957+ return IS_UTF8_IN_INVLIST (p , e , PL_utf8_perl_idcont );
39663958}
39673959
39683960STATIC UV
0 commit comments