summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorRichard Leach <richardleach@users.noreply.github.com>2022-07-28 22:35:24 +0000
committerKarl Williamson <khw@cpan.org>2022-08-05 14:44:12 -0600
commit518db96ae536faa5656a7cdc6b3dc510b75edb79 (patch)
tree0a339e11a13dc7a5381a2f6b2a7624e83be2f6ae /gv.c
parente033b0b9c2bf27f70f0267fc75188d4e7d2fc863 (diff)
downloadperl-518db96ae536faa5656a7cdc6b3dc510b75edb79.tar.gz
Replace sv_2mortal(newSVhek( with newSVhek_mortal
The new Perl_newSVhek_mortal function is slightly more efficient.
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gv.c b/gv.c
index 15d3f0e31c..9db0ada4e6 100644
--- a/gv.c
+++ b/gv.c
@@ -1367,7 +1367,7 @@ Perl_gv_autoload_pvn(pTHX_ HV *stash, const char *name, STRLEN len, U32 flags)
stash = NULL;
}
else
- packname = sv_2mortal(newSVhek(HvNAME_HEK(stash)));
+ packname = newSVhek_mortal(HvNAME_HEK(stash));
if (flags & GV_SUPER) sv_catpvs(packname, "::SUPER");
}
if (!(gv = gv_fetchmeth_pvn(stash, S_autoload, S_autolen, FALSE,
@@ -2744,7 +2744,7 @@ Perl_gv_fullname4(pTHX_ SV *sv, const GV *gv, const char *prefix, bool keepmain)
}
}
else sv_catpvs(sv,"__ANON__::");
- sv_catsv(sv,sv_2mortal(newSVhek(GvNAME_HEK(gv))));
+ sv_catsv(sv,newSVhek_mortal(GvNAME_HEK(gv)));
}
void
@@ -3788,7 +3788,7 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags)
"in overloaded package ":
"has no overloaded magic",
SvAMAGIC(left)?
- SVfARG(sv_2mortal(newSVhek(HvNAME_HEK(SvSTASH(SvRV(left)))))):
+ SVfARG(newSVhek_mortal(HvNAME_HEK(SvSTASH(SvRV(left))))):
SVfARG(&PL_sv_no),
SvAMAGIC(right)?
",\n\tright argument in overloaded package ":
@@ -3796,7 +3796,7 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags)
? ""
: ",\n\tright argument has no overloaded magic"),
SvAMAGIC(right)?
- SVfARG(sv_2mortal(newSVhek(HvNAME_HEK(SvSTASH(SvRV(right)))))):
+ SVfARG(newSVhek_mortal(HvNAME_HEK(SvSTASH(SvRV(right))))):
SVfARG(&PL_sv_no)));
if (use_default_op) {
DEBUG_o( Perl_deb(aTHX_ "%" SVf, SVfARG(msg)) );
@@ -3882,7 +3882,7 @@ Perl_amagic_call(pTHX_ SV *left, SV *right, int method, int flags)
flags & AMGf_unary? "" :
lr==1 ? " for right argument": " for left argument",
flags & AMGf_unary? " for argument" : "",
- stash ? SVfARG(sv_2mortal(newSVhek(HvNAME_HEK(stash)))) : SVfARG(newSVpvs_flags("null", SVs_TEMP)),
+ stash ? SVfARG(newSVhek_mortal(HvNAME_HEK(stash))) : SVfARG(newSVpvs_flags("null", SVs_TEMP)),
fl? ",\n\tassignment variant used": "") );
}
#endif