diff options
author | David Mitchell <davem@iabyn.com> | 2017-07-19 14:21:28 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2017-07-27 11:30:24 +0100 |
commit | 327c9b9e72d9a0e72c98bd828f179f9807a64cef (patch) | |
tree | bc82220978fbe53b23ee8a2d1c0ae77a33694d70 /pp_hot.c | |
parent | ea710183d400fe5d3e69cf573c0c9c6540ce4c5a (diff) | |
download | perl-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.c | 23 |
1 files changed, 4 insertions, 19 deletions
@@ -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); |