From 84875a28d7b7f4db402f82dd5f607497b00db5e6 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Wed, 4 Feb 2015 22:03:03 -0800 Subject: [PATCH] toke.c: Remove redundant PL_lex_stuff null checks In these three code paths, PL_lex_stuff is never null, so there is no need to check that. --- toke.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/toke.c b/toke.c index 3eb6bac..5373510 100644 --- a/toke.c +++ b/toke.c @@ -7677,10 +7677,8 @@ Perl_yylex(pTHX) } if (!words) words = newNULLLIST(); - if (PL_lex_stuff) { - SvREFCNT_dec(PL_lex_stuff); - PL_lex_stuff = NULL; - } + SvREFCNT_dec_NN(PL_lex_stuff); + PL_lex_stuff = NULL; PL_expect = XOPERATOR; pl_yylval.opval = sawparens(words); TOKEN(QWLIST); @@ -8995,10 +8993,8 @@ S_scan_subst(pTHX_ char *start) first_line = CopLINE(PL_curcop); s = scan_str(s,FALSE,FALSE,FALSE,NULL); if (!s) { - if (PL_lex_stuff) { - SvREFCNT_dec(PL_lex_stuff); - PL_lex_stuff = NULL; - } + SvREFCNT_dec_NN(PL_lex_stuff); + PL_lex_stuff = NULL; Perl_croak(aTHX_ "Substitution replacement not terminated"); } PL_multi_start = first_start; /* so whole substitution is taken together */ @@ -9077,10 +9073,8 @@ S_scan_trans(pTHX_ char *start) s = scan_str(s,FALSE,FALSE,FALSE,NULL); if (!s) { - if (PL_lex_stuff) { - SvREFCNT_dec(PL_lex_stuff); - PL_lex_stuff = NULL; - } + SvREFCNT_dec_NN(PL_lex_stuff); + PL_lex_stuff = NULL; Perl_croak(aTHX_ "Transliteration replacement not terminated"); } -- 1.8.3.1