Re: [PATCH++] Re: [PATCH] go faster for Encode's compile
[p5sagit/p5-mst-13.2.git] / regexec.c
index 830488a..900b491 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -924,8 +924,11 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
                STRLEN skip = do_utf8 ? UTF8SKIP(s) : 1;
 
                if (reginclass(c, (U8*)s, do_utf8) ||
-                   (ANYOF_UNICODE_FOLD_SHARP_S(c, s, strend) &&
-                    (skip = 2))) {
+                   (ANYOF_FOLD_SHARP_S(c, s, strend) &&
+                    /* The assignment of 2 is intentional:
+                     * for the sharp s, the skip is 2. */
+                    (skip = SHARP_S_SKIP)
+                    )) {
                    if (tmp && (norun || regtry(prog, s)))
                        goto got_it;
                    else
@@ -2377,8 +2380,8 @@ S_regmatch(pTHX_ regnode *prog)
                char *l = locinput;
                char *e = PL_regeol;
 
-               if (ibcmp_utf8(s, 0,  ln, do_utf8,
-                              l, &e, 0,  UTF)) {
+               if (ibcmp_utf8(s, 0,  ln, UTF,
+                              l, &e, 0,  do_utf8)) {
                     /* One more case for the sharp s:
                      * pack("U0U*", 0xDF) =~ /ss/i,
                      * the 0xC3 0x9F are the UTF-8
@@ -2439,8 +2442,8 @@ S_regmatch(pTHX_ regnode *prog)
            /* If we might have the case of the German sharp s
             * in a casefolding Unicode character class. */
 
-           if (ANYOF_UNICODE_FOLD_SHARP_S(scan, locinput, PL_regeol)) {
-                locinput += 2;
+           if (ANYOF_FOLD_SHARP_S(scan, locinput, PL_regeol)) {
+                locinput += SHARP_S_SKIP;
                 nextchr = UCHARAT(locinput);
            }
            else