summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2017-07-19 14:21:28 +0100
committerDavid Mitchell <davem@iabyn.com>2017-07-27 11:30:24 +0100
commit327c9b9e72d9a0e72c98bd828f179f9807a64cef (patch)
treebc82220978fbe53b23ee8a2d1c0ae77a33694d70 /pp_hot.c
parentea710183d400fe5d3e69cf573c0c9c6540ce4c5a (diff)
downloadperl-327c9b9e72d9a0e72c98bd828f179f9807a64cef.tar.gz
pp_padav(): use S_pushav()
The previous commit harmonised the two functions, so its ok to use S_pushav() now.
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 06639fc9d4..f2d3133204 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1048,26 +1048,11 @@ PP(pp_padav)
gimme = GIMME_V;
if (gimme == G_ARRAY) {
- /* XXX see also S_pushav in pp_hot.c */
- const SSize_t maxarg = AvFILL(MUTABLE_AV(TARG)) + 1;
- EXTEND(SP, maxarg);
- if (SvRMAGICAL(TARG)) {
- SSize_t i;
- for (i=0; i < maxarg; i++) {
- SV * const * const svp = av_fetch(MUTABLE_AV(TARG), i, FALSE);
- SP[i+1] = (svp) ? *svp : &PL_sv_undef;
- }
- }
- else {
- SSize_t i;
- for (i=0; i < maxarg; i++) {
- SV * const sv = AvARRAY((const AV *)TARG)[i];
- SP[i+1] = sv ? sv : &PL_sv_undef;
- }
- }
- SP += maxarg;
+ S_pushav(aTHX_ (AV*)TARG);
+ return NORMAL;
}
- else if (gimme == G_SCALAR) {
+
+ if (gimme == G_SCALAR) {
const SSize_t maxarg = AvFILL(MUTABLE_AV(TARG)) + 1;
if (!maxarg)
PUSHs(&PL_sv_zero);