From: Nicholas Clark Date: Sat, 24 Oct 2009 11:57:18 +0000 (+0100) Subject: In S_pending_ident(), only call gv_fetchpvn_flags() if the warning is enabled. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d824713b62f02cde14f81842e437a248c159a6d1;p=p5sagit%2Fp5-mst-13.2.git In S_pending_ident(), only call gv_fetchpvn_flags() if the warning is enabled. ckWARN(WARN_AMBIGUOUS) is cheaper than Perl_gv_fetchpvn_flags(). --- diff --git a/toke.c b/toke.c index e1f98dc..8c019c5 100644 --- a/toke.c +++ b/toke.c @@ -7129,7 +7129,8 @@ S_pending_ident(pTHX) and @foo isn't a variable we can find in the symbol table. */ - if (pit == '@' && PL_lex_state != LEX_NORMAL && !PL_lex_brackets) { + if (ckWARN(WARN_AMBIGUOUS) && + pit == '@' && PL_lex_state != LEX_NORMAL && !PL_lex_brackets) { GV *const gv = gv_fetchpvn_flags(PL_tokenbuf + 1, tokenbuf_len - 1, 0, SVt_PVAV); if ((!gv || ((PL_tokenbuf[0] == '@') ? !GvAV(gv) : !GvHV(gv))) @@ -7139,9 +7140,9 @@ S_pending_ident(pTHX) ) { /* Downgraded from fatal to warning 20000522 mjd */ - Perl_ck_warner(aTHX_ packWARN(WARN_AMBIGUOUS), - "Possible unintended interpolation of %s in string", - PL_tokenbuf); + Perl_warner(aTHX_ packWARN(WARN_AMBIGUOUS), + "Possible unintended interpolation of %s in string", + PL_tokenbuf); } }