re_intuit_start(): move a line of code earlier
authorDavid Mitchell <davem@iabyn.com>
Sun, 2 Feb 2014 14:14:47 +0000 (14:14 +0000)
committerDavid Mitchell <davem@iabyn.com>
Sat, 8 Feb 2014 13:50:10 +0000 (13:50 +0000)
This makes no functional difference, but makes the two branches
of "other substr" calculate the three values last1, last, s in the same
order.

regexec.c

index e7f8987..5b0303c 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -930,6 +930,11 @@ Perl_re_intuit_start(pTHX_
              *  HOP3(min, anchored_offset)
              *  HOP3(max, anchored_offset) + SvCUR(substr)
              */
+
+            assert(prog->minlen > other->min_offset);
+            last1 = HOP3c(strend,
+                            other->min_offset - prog->minlen, strbeg);
+
             assert(strpos + start_shift <= s);
             last = HOP4c(s, other->min_offset - start_shift,
                         strbeg, strend);
@@ -938,10 +943,6 @@ Perl_re_intuit_start(pTHX_
             if (s < other_last)        /* These positions already checked */
                 s = other_last;
 
-            assert(prog->minlen > other->min_offset);
-            last1 = HOP3c(strend,
-                            other->min_offset - prog->minlen, strbeg);
-
             /* On end-of-str: see comment below. */
             must = utf8_target ? other->utf8_substr : other->substr;
             assert(SvPOK(must));