This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regexec.c: Rmv unnecessary assigns
authorKarl Williamson <khw@cpan.org>
Sun, 17 Mar 2019 16:19:21 +0000 (10:19 -0600)
committerKarl Williamson <khw@cpan.org>
Mon, 18 Mar 2019 16:33:31 +0000 (10:33 -0600)
We never use this variable again (this isn't in a loop unlike similar
cases in other functions in this file), so we don't care if it gets
updated.  Instead use the source value directly.

regexec.c

index 26825c7..2d603fd 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -9578,8 +9578,8 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
             /* LNBREAK can match one or two latin chars, which is ok, but we
              * have to use hardcount in this situation, and throw away the
              * adjustment to <loceol> done before the switch statement */
-            loceol = reginfo->strend;
-           while (scan < loceol && (c=is_LNBREAK_latin1_safe(scan, loceol))) {
+            ;
+           while (scan < reginfo->strend && (c=is_LNBREAK_latin1_safe(scan, reginfo->strend))) {
                scan+=c;
                hardcount++;
            }