Change 27526 by [EMAIL PROTECTED] on 2006/03/17 02:57:45

        reduce S_regrepeat_hard() callers from 3 to 1

Affected files ...

... //depot/perl/regexec.c#376 edit

Differences ...

==== //depot/perl/regexec.c#376 (text) ====
Index: perl/regexec.c
--- perl/regexec.c#375~27448~   2006-03-09 12:48:50.000000000 -0800
+++ perl/regexec.c      2006-03-16 18:57:45.000000000 -0800
@@ -3714,6 +3714,7 @@
        {
            I32 l = 0;
            CHECKPOINT lastcp;
+           I32 count;
        
            /* We suppose that the next guy does not need
               backtracking: in particular, it is of constant non-zero length,
@@ -3731,9 +3732,12 @@
            if (paren)
                scan += NEXT_OFF(scan); /* Skip former OPEN. */
            PL_reginput = locinput;
+           count = minmod ? ln : n;
+           if (count)
+               count = regrepeat_hard(scan, count, &l);
            if (minmod) {
                minmod = 0;
-               if (ln && regrepeat_hard(scan, ln, &l) < ln)
+               if (ln && count < ln)
                    sayNO;
                locinput = PL_reginput;
                if (HAS_TEXT(next) || JUMPABLE(next)) {
@@ -3781,7 +3785,7 @@
                    }
                    /* Couldn't or didn't -- move forward. */
                    PL_reginput = locinput;
-                   if (regrepeat_hard(scan, 1, &l)) {
+                   if (regmatch(scan)) {
                        ln++;
                        locinput = PL_reginput;
                    }
@@ -3790,7 +3794,7 @@
                }
            }
            else {
-               n = regrepeat_hard(scan, n, &l);
+               n = count;
                locinput = PL_reginput;
                DEBUG_EXECUTE_r(
                    PerlIO_printf(Perl_debug_log,
End of Patch.

Reply via email to