Don’t check for tied @DB'args when not REAL
authorFather Chrysostomos <sprout@cpan.org>
Tue, 27 Dec 2011 08:11:12 +0000 (00:11 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 27 Dec 2011 08:43:06 +0000 (00:43 -0800)
This should make things just a smidgen faster in the most common case.

As of the previous commit, tied arrays are always AvREAL.

perl.c

diff --git a/perl.c b/perl.c
index b064da6..a24947c 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -3889,9 +3889,9 @@ Perl_init_dbargs(pTHX)
           It might have entries, and if we just turn off AvREAL(), they will
           "leak" until global destruction.  */
        av_clear(args);
+       if (SvTIED_mg((const SV *)args, PERL_MAGIC_tied))
+           sv_unmagic((const SV *)args, PERL_MAGIC_tied);
     }
-    if (SvTIED_mg((const SV *)args, PERL_MAGIC_tied))
-       sv_unmagic((const SV *)args, PERL_MAGIC_tied);
     AvREIFY_only(PL_dbargs);
 }