diff options
author | Richard Leach <richardleach@users.noreply.github.com> | 2022-07-20 21:38:57 +0000 |
---|---|---|
committer | Richard Leach <richardleach@users.noreply.github.com> | 2022-09-17 23:02:40 +0100 |
commit | 33498ed6ab04d6249c8585950bfd9321db9d2fa7 (patch) | |
tree | b02604a9379d4510d52292df1d731d701fac5670 | |
parent | e05fbdc05a0939b5cd888a582885fa4f74883f51 (diff) | |
download | perl-33498ed6ab04d6249c8585950bfd9321db9d2fa7.tar.gz |
sv_setsv_cow - directly create desired SVt_COW SV
It's more efficient to directly create the desired SV type than create
a SVt_NULL and then call sv_upgrade to get the desired type.
-rw-r--r-- | sv.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -4783,10 +4783,10 @@ Perl_sv_setsv_cow(pTHX_ SV *dsv, SV *ssv) sv_force_normal_flags(dsv, SV_COW_DROP_PV); else if (SvPVX_const(dsv)) Safefree(SvPVX_mutable(dsv)); + SvUPGRADE(dsv, SVt_COW); } else - new_SV(dsv); - SvUPGRADE(dsv, SVt_COW); + dsv = newSV_type(SVt_COW); assert (SvPOK(ssv)); assert (SvPOKp(ssv)); |