summaryrefslogtreecommitdiff
path: root/mro_core.c
diff options
context:
space:
mode:
authorRichard Leach <richardleach@users.noreply.github.com>2022-06-07 22:17:04 +0000
committerKarl Williamson <khw@cpan.org>2022-06-08 09:41:44 -0600
commit74279cb654174c8653f8e15198a6aa843636148e (patch)
treecd69ab896beaf66c5155be59fe932be400555960 /mro_core.c
parenteae3cc9643eecd5d8b27c8fb4a3dc3bfebaf57e3 (diff)
downloadperl-74279cb654174c8653f8e15198a6aa843636148e.tar.gz
Make use of av_push_simple in a few places.
Specifically, only where a new AV has just been created and it's therefore obvious that av_push_simple is safe to use. In many cases, nearby code does av_push to an existing array. It might well be the case that these are simple arrays and av_push_simple could be used instead. The necessary analysis has been left for the future.
Diffstat (limited to 'mro_core.c')
-rw-r--r--mro_core.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mro_core.c b/mro_core.c
index 42a11af035..235dacaec7 100644
--- a/mro_core.c
+++ b/mro_core.c
@@ -268,7 +268,7 @@ S_mro_get_linear_isa_dfs(pTHX_ HV *stash, U32 level)
/* We use this later in this function, but don't need a reference to it
beyond the end of this function, so reference count is fine. */
our_name = newSVhek(stashhek);
- av_push(retval, our_name); /* add ourselves at the top */
+ av_push_simple(retval, our_name); /* add ourselves at the top */
/* fetch our @ISA */
gvp = (GV**)hv_fetchs(stash, "ISA", FALSE);
@@ -326,7 +326,7 @@ S_mro_get_linear_isa_dfs(pTHX_ HV *stash, U32 level)
HeVAL(he) = &PL_sv_undef;
sv_sethek(val, key);
- av_push(retval, val);
+ av_push_simple(retval, val);
}
}
} else {
@@ -358,7 +358,7 @@ S_mro_get_linear_isa_dfs(pTHX_ HV *stash, U32 level)
as if we'd copied it from what theirs should be. */
stored = MUTABLE_HV(newSV_type_mortal(SVt_PVHV));
(void) hv_stores(stored, "UNIVERSAL", &PL_sv_undef);
- av_push(retval,
+ av_push_simple(retval,
newSVhek(HeKEY_hek(hv_store_ent(stored, sv,
&PL_sv_undef, 0))));
}
@@ -846,7 +846,7 @@ Perl_mro_package_moved(pTHX_ HV * const stash, HV * const oldstash,
GvNAMEUTF8(gv) ? SV_CATUTF8 : SV_CATBYTES
);
}
- av_push((AV *)namesv, aname);
+ av_push_simple((AV *)namesv, aname);
}
}
@@ -1186,7 +1186,7 @@ S_mro_gather_and_rename(pTHX_ HV * const stashes, HV * const seen_stashes,
? SV_CATUTF8 : SV_CATBYTES
);
}
- av_push((AV *)subname, aname);
+ av_push_simple((AV *)subname, aname);
}
}
else {
@@ -1269,7 +1269,7 @@ S_mro_gather_and_rename(pTHX_ HV * const stashes, HV * const seen_stashes,
? SV_CATUTF8 : SV_CATBYTES
);
}
- av_push((AV *)subname, aname);
+ av_push_simple((AV *)subname, aname);
}
}
else {