This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
toke.c: move leftbracket label
authorFather Chrysostomos <sprout@cpan.org>
Mon, 6 Aug 2012 15:41:07 +0000 (08:41 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 6 Aug 2012 21:04:03 +0000 (14:04 -0700)
The only code path that goesto leftbracket was precede by s--.
The first thing leftbracket did was s++.

We can simplify the code slighty by moving the label down one
statement and not s--ing before goingto leftbracket.

toke.c

diff --git a/toke.c b/toke.c
index 84685b0..02b6b86 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -5687,8 +5687,8 @@ Perl_yylex(pTHX)
        }
        TERM(']');
     case '{':
-      leftbracket:
        s++;
+      leftbracket:
        if (PL_lex_brackets > 100) {
            Renew(PL_lex_brackstack, PL_lex_brackets + 10, char);
        }
@@ -6024,7 +6024,6 @@ Perl_yylex(pTHX)
 #endif
                t++;
            if (*t == '\n' || *t == '#') {
-               s--;
                PL_expect = XBLOCK;
                formbrack = TRUE;
                ENTER;