This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Simplify magic logic in av.c:av_store
authorFather Chrysostomos <sprout@cpan.org>
Sun, 8 Jan 2012 02:38:35 +0000 (18:38 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 8 Jan 2012 20:43:26 +0000 (12:43 -0800)
av.c

diff --git a/av.c b/av.c
index 01b565f..1671f16 100644 (file)
--- a/av.c
+++ b/av.c
@@ -365,8 +365,7 @@ Perl_av_store(pTHX_ register AV *av, I32 key, SV *val)
        const MAGIC *mg = SvMAGIC(av);
        bool set = TRUE;
        for (; mg; mg = mg->mg_moremagic) {
-         const int eletype = toLOWER(mg->mg_type);
-         if (eletype == mg->mg_type) continue;
+         if (!isUPPER(mg->mg_type)) continue;
          if (val != &PL_sv_undef) {
            sv_magic(val, MUTABLE_SV(av), toLOWER(mg->mg_type), 0, key);
          }