diff options
author | Nicholas Clark <nick@ccl4.org> | 2021-07-20 14:11:13 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2021-07-26 07:06:00 +0000 |
commit | bffed14d6aeedc70a2f799ef7c8fe1f5d608eb52 (patch) | |
tree | ef4f6c8e2a284bf3ea34d9c674462f9af55c8fae /op.c | |
parent | 0cdaae3e56c7eb2fab73f258cf564fe0d6d1b083 (diff) | |
download | perl-bffed14d6aeedc70a2f799ef7c8fe1f5d608eb52.tar.gz |
Where the key is an SV, replace some hv_* calls with hv_*_ent equivalents.
This avoids the SvUTF8(tmpstr) ? -(I32)SvCUR(tmpstr) : (I32)SvCUR(tmpstr)
code dance.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -11142,10 +11142,9 @@ Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) sv_catpvn_flags(tmpstr, PadnamePV(name)+1, PadnameLEN(name)-1, PadnameUTF8(name) ? SV_CATUTF8 : SV_CATBYTES); - (void)hv_store(GvHV(PL_DBsub), SvPVX_const(tmpstr), - SvUTF8(tmpstr) ? -(I32)SvCUR(tmpstr) : (I32)SvCUR(tmpstr), sv, 0); + (void)hv_store_ent(GvHV(PL_DBsub), tmpstr, sv, 0); hv = GvHVn(db_postponed); - if (HvTOTALKEYS(hv) > 0 && hv_exists(hv, SvPVX_const(tmpstr), SvUTF8(tmpstr) ? -(I32)SvCUR(tmpstr) : (I32)SvCUR(tmpstr))) { + if (HvTOTALKEYS(hv) > 0 && hv_exists_ent(hv, tmpstr, 0)) { CV * const pcv = GvCV(db_postponed); if (pcv) { dSP; @@ -11722,10 +11721,9 @@ Perl_newATTRSUB_x(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, CopFILE(PL_curcop), (long)PL_subline, (long)CopLINE(PL_curcop)); - (void)hv_store(GvHV(PL_DBsub), SvPVX_const(tmpstr), - SvUTF8(tmpstr) ? -(I32)SvCUR(tmpstr) : (I32)SvCUR(tmpstr), sv, 0); + (void)hv_store_ent(GvHV(PL_DBsub), tmpstr, sv, 0); hv = GvHVn(db_postponed); - if (HvTOTALKEYS(hv) > 0 && hv_exists(hv, SvPVX_const(tmpstr), SvUTF8(tmpstr) ? -(I32)SvCUR(tmpstr) : (I32)SvCUR(tmpstr))) { + if (HvTOTALKEYS(hv) > 0 && hv_exists_ent(hv, tmpstr, 0)) { CV * const pcv = GvCV(db_postponed); if (pcv) { dSP; |