diff options
author | Richard Leach <richardleach@users.noreply.github.com> | 2021-04-07 22:45:37 +0100 |
---|---|---|
committer | Hugo van der Sanden <hv@crypt.org> | 2021-05-22 16:14:46 +0100 |
commit | a043512d92ca47f385148b776420a6438dc1d137 (patch) | |
tree | e6accde52d3382b76cfd0d985eb095e221d39052 /pad.c | |
parent | 805d541fd64ec3a502581bc9d0e8e035071be896 (diff) | |
download | perl-a043512d92ca47f385148b776420a6438dc1d137.tar.gz |
Perl_pad_push: assign the SV to store in sv, use single av_store()
Diffstat (limited to 'pad.c')
-rw-r--r-- | pad.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -2397,6 +2397,7 @@ Perl_pad_push(pTHX_ PADLIST *padlist, int depth) AV *av; for ( ;ix > 0; ix--) { + SV *sv; if (names_fill >= ix && PadnameLEN(names[ix])) { const char sigil = PadnamePV(names[ix])[0]; if (PadnameOUTER(names[ix]) @@ -2404,28 +2405,26 @@ Perl_pad_push(pTHX_ PADLIST *padlist, int depth) || sigil == '&') { /* outer lexical or anon code */ - av_store(newpad, ix, SvREFCNT_inc(oldpad[ix])); + sv = SvREFCNT_inc(oldpad[ix]); } else { /* our own lexical */ - SV *sv; if (sigil == '@') sv = MUTABLE_SV(newAV()); else if (sigil == '%') sv = MUTABLE_SV(newHV()); else sv = newSV(0); - av_store(newpad, ix, sv); } } else if (PadnamePV(names[ix])) { - av_store(newpad, ix, SvREFCNT_inc_NN(oldpad[ix])); + sv = SvREFCNT_inc_NN(oldpad[ix]); } else { /* save temporaries on recursion? */ - SV * const sv = newSV(0); - av_store(newpad, ix, sv); + sv = newSV(0); SvPADTMP_on(sv); } + av_store(newpad, ix, sv); } av = newAV(); av_store(newpad, 0, MUTABLE_SV(av)); |