mirror of
https://github.com/Perl/perl5.git
synced 2026-01-26 16:39:36 +00:00
utf8.c: Extra branch to avoid others in the typical case
This test eliminates all code points less than U+D800 from having to be checked more than once, at the expense of an extra test for code points that are larger
This commit is contained in:
parent
2893616440
commit
979f77b669
5
utf8.c
5
utf8.c
@ -137,7 +137,10 @@ Perl_uvuni_to_utf8_flags(pTHX_ U8 *d, UV uv, UV flags)
|
||||
{
|
||||
PERL_ARGS_ASSERT_UVUNI_TO_UTF8_FLAGS;
|
||||
|
||||
if (ckWARN4_d(WARN_UTF8, WARN_SURROGATE, WARN_NON_UNICODE, WARN_NONCHAR)) {
|
||||
/* The first problematic code point is the first surrogate */
|
||||
if (uv >= UNICODE_SURROGATE_FIRST
|
||||
&& ckWARN4_d(WARN_UTF8, WARN_SURROGATE, WARN_NON_UNICODE, WARN_NONCHAR))
|
||||
{
|
||||
if (UNICODE_IS_SURROGATE(uv)) {
|
||||
if (flags & UNICODE_WARN_SURROGATE) {
|
||||
Perl_ck_warner_d(aTHX_ packWARN(WARN_SURROGATE),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user