summaryrefslogtreecommitdiff
path: root/mro.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-04-20 19:34:15 +0000
committerNicholas Clark <nick@ccl4.org>2007-04-20 19:34:15 +0000
commit33e12d9d267d9578365b1a5116be5449323ba82f (patch)
treec383fb4c152a9303a0a0171d4e9ff2e50334bd3d /mro.c
parent434ec8674831cacab31d87425c59901c395d912d (diff)
downloadperl-33e12d9d267d9578365b1a5116be5449323ba82f.tar.gz
Terser source code in Perl_mro_meta_dup()
p4raw-id: //depot/perl@31000
Diffstat (limited to 'mro.c')
-rw-r--r--mro.c33
1 files changed, 15 insertions, 18 deletions
diff --git a/mro.c b/mro.c
index 1fa2a3792a..dff731af3e 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;
}