From 3e1892cc8d6022664f01f9119761911b28090cf1 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 27 Nov 2010 13:05:16 -0800 Subject: 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. --- sv.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sv.c') diff --git a/sv.c b/sv.c index 5199268524..92634e118e 100644 --- a/sv.c +++ b/sv.c @@ -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; } -- cgit v1.2.1