summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-11-27 13:05:16 -0800
committerFather Chrysostomos <sprout@cpan.org>2010-11-27 13:17:50 -0800
commit3e1892cc8d6022664f01f9119761911b28090cf1 (patch)
treef9ce9a30292fe4d0a74cd400afedf3740cf1987c /sv.c
parent75f5d3312d21b538131a8f964451f5ab0e11b75b (diff)
downloadperl-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.c8
1 files changed, 6 insertions, 2 deletions
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;
}