This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Bypass unneeded step
authorKarl Williamson <public@khwilliamson.com>
Fri, 11 Nov 2011 20:05:19 +0000 (13:05 -0700)
committerKarl Williamson <public@khwilliamson.com>
Fri, 11 Nov 2011 20:41:41 +0000 (13:41 -0700)
We don't have to convert from utf8 to code point to fold; instead can
call the function that starts from utf8

regexec.c

index 56d1a5c..ced20bd 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -1200,8 +1200,8 @@ uvc, charid, foldlen, foldbuf, uniflags) STMT_START {                       \
            uscan += len;                                                   \
            len=0;                                                          \
        } else {                                                            \
-           uvc = utf8n_to_uvuni( (U8*)uc, UTF8_MAXLEN, &len, uniflags ); \
-           uvc = to_uni_fold( uvc, foldbuf, &foldlen );                    \
+           uvc = to_utf8_fold( (U8 *) uc, foldbuf, &foldlen );             \
+           len = UTF8SKIP(uc); \
            foldlen -= UNISKIP( uvc );                                      \
            uscan = foldbuf + UNISKIP( uvc );                               \
        }                                                                   \