summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorRichard Leach <richardleach@users.noreply.github.com>2022-09-09 21:47:05 +0000
committerRichard Leach <richardleach@users.noreply.github.com>2022-09-18 23:50:26 +0100
commit94e822ee24ba222efc1979d79e64ca7b2c0942cb (patch)
tree367e22241dad5be2ca1af27b76a0e9263dfd548e /sv.c
parent51918aaf0287a9f5643ea3161fd8c6091a127428 (diff)
downloadperl-94e822ee24ba222efc1979d79e64ca7b2c0942cb.tar.gz
vnewSVpvf - inline & reduce call to sv_vsetpvfn
sv_vsetpvfn does just two things: * SvPVCLEAR on the sv passed in * calls sv_vcatpvfn_flags Since the SV passed into sv_vsetpvfn by vnewSVpvf is a brand new SV, it is more efficient to inline sv_vsetpvfn and change the SvPVCLEAR to SvPVCLEAR_FRESH.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sv.c b/sv.c
index 7fe093e1c6..6585845c89 100644
--- a/sv.c
+++ b/sv.c
@@ -9767,8 +9767,9 @@ Perl_vnewSVpvf(pTHX_ const char *const pat, va_list *const args)
PERL_ARGS_ASSERT_VNEWSVPVF;
- new_SV(sv);
- sv_vsetpvfn(sv, pat, strlen(pat), args, NULL, 0, NULL);
+ sv = newSV(1);
+ SvPVCLEAR_FRESH(sv);
+ sv_vcatpvfn_flags(sv, pat, strlen(pat), args, NULL, 0, NULL, 0);
return sv;
}