summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-09-06 00:51:16 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-09-06 06:18:08 -0700
commit199f858d54d30a550be7320e065420353bca5318 (patch)
treed59886518fdbd5c6bb873ebe8e54526cb45f521f /pp_ctl.c
parentdd2a7f9048da2c440a4dfed5122c0bfd98f079d3 (diff)
downloadperl-199f858d54d30a550be7320e065420353bca5318.tar.gz
Put AV defelem creation code in one place
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index b7b3598b7c..d091e29f0e 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2910,14 +2910,8 @@ PP(pp_goto)
if (SP[-index])
SvREFCNT_inc_void_NN(sv_2mortal(SP[-index]));
else {
- SV * const lv =
- sv_2mortal(newSV_type(SVt_PVLV));
- SP[-index] = lv;
- LvTYPE(lv) = 'y';
- sv_magic(lv,NULL,PERL_MAGIC_defelem,NULL,0);
- LvTARG(lv) = SvREFCNT_inc_simple_NN(arg);
- LvSTARGOFF(lv) = AvFILLp(arg) - index;
- LvTARGLEN(lv) = 1;
+ SP[-index] = sv_2mortal(newSVavdefelem(arg,
+ AvFILLp(arg) - index, 1));
}
}
SvREFCNT_dec(arg);