diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-11-27 13:05:16 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-11-27 13:17:50 -0800 |
commit | 3e1892cc8d6022664f01f9119761911b28090cf1 (patch) | |
tree | f9ce9a30292fe4d0a74cd400afedf3740cf1987c /sv.c | |
parent | 75f5d3312d21b538131a8f964451f5ab0e11b75b (diff) | |
download | perl-3e1892cc8d6022664f01f9119761911b28090cf1.tar.gz |
Make *ISA assignment slightly faster
Since we already know the array is magical and we already
have a pointer to the magic half the time, we can call
Perl_magic_clearisa directly.
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -3842,14 +3842,18 @@ S_glob_assign_ref(pTHX_ SV *const dstr, SV *const sstr) av_push((AV *)mg->mg_obj,SvREFCNT_inc_simple_NN(dstr)); } else + { sv_magic( sref, omg ? omg->mg_obj : dstr, PERL_MAGIC_isa, NULL, 0 ); + mg = mg_find(sref, PERL_MAGIC_isa); + } /* Since the *ISA assignment could have affected more than one stash, don’t call mro_isa_changed_in directly, but let - magic_setisa do it for us, as it already has the logic for + magic_clearisa do it for us, as it already has the logic for dealing with globs vs arrays of globs. */ - SvSETMAGIC(sref); + assert(mg); + Perl_magic_clearisa(aTHX_ NULL, mg); } break; } |