summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorRichard Leach <richardleach@users.noreply.github.com>2021-12-09 22:25:38 +0000
committerKarl Williamson <khw@cpan.org>2021-12-24 08:35:35 -0700
commit28b7611abf757b803ec5b296d60fc99763c1c8d0 (patch)
treef01a2cb947a60e447f443705a2fc9dcdaf6ba6f2 /sv.c
parentb135e9358aa994456ec32ccfe7a73e685f598797 (diff)
downloadperl-28b7611abf757b803ec5b296d60fc99763c1c8d0.tar.gz
sv_upgrade: remove redundant AvALLOC(sv) = 0
xav_alloc is a member of the xpvav struct. The instance modified here would have been Zero()ed several lines previously, so both sides of this if() branch should be no-ops. With gcc 8.3.0 the compiled function is about 6 instructions smaller.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/sv.c b/sv.c
index aa8b97c315..8a2987f36f 100644
--- a/sv.c
+++ b/sv.c
@@ -1371,13 +1371,6 @@ Perl_sv_upgrade(pTHX_ SV *const sv, svtype new_type)
AvMAX(sv) = -1;
AvFILLp(sv) = -1;
AvREAL_only(sv);
- if (old_type_details->body_size) {
- AvALLOC(sv) = 0;
- } else {
- /* It will have been zeroed when the new body was allocated.
- Lets not write to it, in case it confuses a write-back
- cache. */
- }
} else {
assert(!SvOK(sv));
SvOK_off(sv);