From: Nicholas Clark Date: Thu, 25 Feb 2010 16:56:53 +0000 (+0000) Subject: In Perl_pad_tidy(), merge the SvPADTMP_on() loops for padtidy_SUB and _FORMAT. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4cee4ca8b28e9dadc530df8ce100439bc4a78e73;p=p5sagit%2Fp5-mst-13.2.git In Perl_pad_tidy(), merge the SvPADTMP_on() loops for padtidy_SUB and _FORMAT. --- diff --git a/pad.c b/pad.c index c7a18c2..207f475 100644 --- a/pad.c +++ b/pad.c @@ -1304,9 +1304,7 @@ Perl_pad_tidy(pTHX_ padtidy_type type) AvREIFY_only(av); } - /* XXX DAPM rationalise these two similar branches */ - - if (type == padtidy_SUB) { + if (type == padtidy_SUB || type == padtidy_FORMAT) { PADOFFSET ix; for (ix = AvFILLp(PL_comppad); ix > 0; ix--) { if (SvIMMORTAL(PL_curpad[ix]) || IS_PADGV(PL_curpad[ix]) || IS_PADCONST(PL_curpad[ix])) @@ -1315,13 +1313,6 @@ Perl_pad_tidy(pTHX_ padtidy_type type) SvPADTMP_on(PL_curpad[ix]); } } - else if (type == padtidy_FORMAT) { - PADOFFSET ix; - for (ix = AvFILLp(PL_comppad); ix > 0; ix--) { - if (!SvPADMY(PL_curpad[ix]) && !SvIMMORTAL(PL_curpad[ix])) - SvPADTMP_on(PL_curpad[ix]); - } - } PL_curpad = AvARRAY(PL_comppad); }