Skip to content

Commit

Permalink
Perl_pad_alloc: nature of PL_comppad allows simplification of av_fetc…
Browse files Browse the repository at this point in the history
…h() calls
  • Loading branch information
richardleach committed Jun 24, 2021
1 parent ad9e8f6 commit 155df17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pad.c
Expand Up @@ -712,7 +712,7 @@ Perl_pad_alloc(pTHX_ I32 optype, U32 tmptype)
pad_reset();
if (tmptype == SVs_PADMY) { /* Not & because this ‘flag’ is 0. */
/* For a my, simply push a null SV onto the end of PL_comppad. */
sv = *av_fetch(PL_comppad, AvFILLp(PL_comppad) + 1, TRUE);
sv = *av_store_simple(PL_comppad, AvFILLp(PL_comppad) + 1, newSV(0));
retval = (PADOFFSET)AvFILLp(PL_comppad);
}
else {
Expand All @@ -739,7 +739,7 @@ Perl_pad_alloc(pTHX_ I32 optype, U32 tmptype)
if (++retval <= names_fill &&
(pn = names[retval]) && PadnamePV(pn))
continue;
sv = *av_fetch(PL_comppad, retval, TRUE);
sv = *av_fetch_simple(PL_comppad, retval, TRUE);
if (!(SvFLAGS(sv) &
#ifdef USE_PAD_RESET
(konst ? SVs_PADTMP : 0)
Expand Down

0 comments on commit 155df17

Please sign in to comment.