From f73391e47e605dbc951ddd9776e3c8c25686d2d7 Mon Sep 17 00:00:00 2001 From: Richard Leach Date: Mon, 2 Nov 2020 22:52:19 +0000 Subject: av_make: remove unnecessary AvFILLp assignment av_make sets `AvFILLp(av)= -1;`, but will already have been set by `newAV()`, via `newSV_type`'s call to `sv_upgrade`. This PR also includes the minor cosmetic change of swapping in `newAV()` in place of its expansion, seemingly the only occurrence of that in core. --- av.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'av.c') diff --git a/av.c b/av.c index 24295eacc9..b0a4d8d1cb 100644 --- a/av.c +++ b/av.c @@ -410,7 +410,7 @@ Perl equivalent: C AV * Perl_av_make(pTHX_ SSize_t size, SV **strp) { - AV * const av = MUTABLE_AV(newSV_type(SVt_PVAV)); + AV * const av = newAV(); /* sv_upgrade does AvREAL_only() */ PERL_ARGS_ASSERT_AV_MAKE; assert(SvTYPE(av) == SVt_PVAV); @@ -424,7 +424,6 @@ Perl_av_make(pTHX_ SSize_t size, SV **strp) AvALLOC(av) = ary; AvARRAY(av) = ary; AvMAX(av) = size - 1; - AvFILLp(av) = -1; /* avoid av being leaked if croak when calling magic below */ EXTEND_MORTAL(1); PL_tmps_stack[++PL_tmps_ix] = (SV*)av; -- cgit v1.2.1