Skip to content

Commit

Permalink
Perl_pad_alloc: simplify av_fetch() calls
Browse files Browse the repository at this point in the history
The nature of PL_comppad allows this.
  • Loading branch information
richardleach authored and hvds committed Jul 3, 2021
1 parent 84c7520 commit 310f47b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pad.c
Expand Up @@ -719,7 +719,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 @@ -746,7 +746,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 310f47b

Please sign in to comment.