From: Nicholas Clark Date: Fri, 20 Apr 2007 19:34:15 +0000 (+0000) Subject: Terser source code in Perl_mro_meta_dup() X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=33e12d9d267d9578365b1a5116be5449323ba82f;p=p5sagit%2Fp5-mst-13.2.git Terser source code in Perl_mro_meta_dup() p4raw-id: //depot/perl@31000 --- diff --git a/mro.c b/mro.c index 1fa2a37..dff731a 100644 --- a/mro.c +++ b/mro.c @@ -58,24 +58,21 @@ Perl_mro_meta_dup(pTHX_ struct mro_meta* smeta, CLONE_PARAMS* param) assert(smeta); - Newxz(newmeta, 1, struct mro_meta); - - newmeta->mro_which = smeta->mro_which; - newmeta->sub_generation = smeta->sub_generation; - newmeta->is_universal = smeta->is_universal; - newmeta->fake = smeta->fake; - newmeta->mro_linear_dfs = smeta->mro_linear_dfs - ? (AV*) SvREFCNT_inc(sv_dup((SV*)smeta->mro_linear_dfs, param)) - : 0; - newmeta->mro_linear_c3 = smeta->mro_linear_c3 - ? (AV*) SvREFCNT_inc(sv_dup((SV*)smeta->mro_linear_c3, param)) - : 0; - newmeta->mro_isarev = smeta->mro_isarev - ? (HV*) SvREFCNT_inc(sv_dup((SV*)smeta->mro_isarev, param)) - : 0; - newmeta->mro_nextmethod = smeta->mro_nextmethod - ? (HV*) SvREFCNT_inc(sv_dup((SV*)smeta->mro_nextmethod, param)) - : 0; + Newx(newmeta, 1, struct mro_meta); + Copy(smeta, newmeta, 1, struct mro_meta); + + if (newmeta->mro_linear_dfs) + newmeta->mro_linear_dfs + = (AV*) SvREFCNT_inc(sv_dup((SV*)newmeta->mro_linear_dfs, param)); + if (newmeta->mro_linear_c3) + newmeta->mro_linear_c3 + = (AV*) SvREFCNT_inc(sv_dup((SV*)newmeta->mro_linear_c3, param)); + if (newmeta->mro_isarev) + newmeta->mro_isarev + = (HV*) SvREFCNT_inc(sv_dup((SV*)newmeta->mro_isarev, param)); + if (newmeta->mro_nextmethod) + newmeta->mro_nextmethod + = (HV*) SvREFCNT_inc(sv_dup((SV*)newmeta->mro_nextmethod, param)); return newmeta; }