From c0e0ec46b63bba8f76af7b2b923a04d38bb671f3 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Thu, 26 Dec 2013 20:54:08 +0000 Subject: [PATCH] re_intuit_start(): factor out some common code 3 assignments are done at the end of both branches of an if/else; factor them out after the end. --- regexec.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/regexec.c b/regexec.c index 08f1066..7c56623 100644 --- a/regexec.c +++ b/regexec.c @@ -744,21 +744,15 @@ Perl_re_intuit_start(pTHX_ } /* Match is anchored, but substr is not anchored wrt beg-of-str. */ - s = strpos; - start_shift = prog->check_offset_min; /* okay to underestimate on CC */ - end_shift = prog->check_end_shift; - if (!ml_anch && prog->check_offset_max != SSize_t_MAX) max_shift = prog->check_offset_max; } else { /* Can match at random position */ ml_anch = 0; - s = strpos; - start_shift = prog->check_offset_min; /* okay to underestimate on CC */ - end_shift = prog->check_end_shift; - - /* end shift should be non negative here */ } + s = strpos; + start_shift = prog->check_offset_min; /* okay to underestimate on CC */ + end_shift = prog->check_end_shift; #ifdef DEBUGGING /* 7/99: reports of failure (with the older version) */ if (end_shift < 0) -- 2.7.4