This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pad.c:pad_tidy: Remove IS_PADCONST and another IS_PADGV
authorFather Chrysostomos <sprout@cpan.org>
Thu, 18 Sep 2014 03:25:54 +0000 (20:25 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 18 Sep 2014 06:39:29 +0000 (23:39 -0700)
Checking these is no longer necessary, since the only thing this loop
does is handle entries that close over variables from outer subrou-
tines.  IS_PADGV and IS_PADCONST will never be true for those.

pad.c

diff --git a/pad.c b/pad.c
index 2f62504..8da66f0 100644 (file)
--- a/pad.c
+++ b/pad.c
@@ -1801,8 +1801,7 @@ Perl_pad_tidy(pTHX_ padtidy_type type)
        PADOFFSET ix;
        for (ix = AvFILLp(PL_comppad); ix > 0; ix--) {
            if (!namep[ix]) namep[ix] = &PL_sv_undef;
        PADOFFSET ix;
        for (ix = AvFILLp(PL_comppad); ix > 0; ix--) {
            if (!namep[ix]) namep[ix] = &PL_sv_undef;
-           if (!PL_curpad[ix] || SvIMMORTAL(PL_curpad[ix])
-                || IS_PADGV(PL_curpad[ix]) || IS_PADCONST(PL_curpad[ix]))
+           if (!PL_curpad[ix] || SvIMMORTAL(PL_curpad[ix]))
                continue;
            if (SvPADMY(PL_curpad[ix]) && !SvFAKE(namep[ix])) {
                /* This is a work around for how the current implementation of
                continue;
            if (SvPADMY(PL_curpad[ix]) && !SvFAKE(namep[ix])) {
                /* This is a work around for how the current implementation of