regexec.c:regexec_flags: Remove unused var
authorFather Chrysostomos <sprout@cpan.org>
Sat, 27 Jul 2013 14:10:08 +0000 (07:10 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 25 Aug 2013 19:22:47 +0000 (12:22 -0700)
This variable, end_shift, only ever holds the value 0.  It is used in
only one place, where its value is assigned to another variable.

The history is interesting:

start_shift and end_shift were added in c277df42229, which added sub-
string optimisations.  146174a91a192 rearranged stuff a bit, causing
these variables to be unused.  155aba94f6 commented out the unused
start_shift to suppress a compiler warning.  1df70142a966e remove=
the start_shift comment, leaving the comment describing end_shift
nonsensical.

regexec.c

index 44690b3..a1d61a5 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -2221,7 +2221,6 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
     char *startpos;
     I32 minlen;                /* must match at least this many chars */
     I32 dontbother = 0;        /* how many characters not to try at end */
-    I32 end_shift = 0;                 /* Same for the end. */         /* CC */
     const bool utf8_target = cBOOL(DO_UTF8(sv));
     I32 multiline;
     RXi_GET_DECL(prog,progi);
@@ -2660,7 +2659,7 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
 
        /* XXXX check_substr already used to find "s", can optimize if
           check_substr==must. */
-       dontbother = end_shift;
+       dontbother = 0;
        strend = HOPc(strend, -dontbother);
        while ( (s <= last) &&
                (s = fbm_instr((unsigned char*)HOP3(s, back_min, (back_min<0 ? strbeg : strend)),