summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2009-07-25 18:24:31 +0200
committerVincent Pit <perl@profvince.com>2009-07-25 23:26:07 +0200
commit47cfc530daffd82ce559257488607278cf379aa8 (patch)
treeca57b33e57f049aa15c250149d00870360bec57d
parentaf097752b446f87855473ee776be3a2d7b735986 (diff)
downloadperl-47cfc530daffd82ce559257488607278cf379aa8.tar.gz
Use the new SAVEHDELETE() macro wherever possible
-rw-r--r--pp.c16
-rw-r--r--pp_hot.c15
2 files changed, 10 insertions, 21 deletions
diff --git a/pp.c b/pp.c
index 9cedc3fe47..107a396681 100644
--- a/pp.c
+++ b/pp.c
@@ -4201,17 +4201,11 @@ PP(pp_hslice)
if (localizing) {
if (HvNAME_get(hv) && isGV(*svp))
save_gp(MUTABLE_GV(*svp), !(PL_op->op_flags & OPf_SPECIAL));
- else {
- if (preeminent)
- save_helem_flags(hv, keysv, svp,
- (PL_op->op_flags & OPf_SPECIAL) ? 0 : SAVEf_SETMAGIC);
- else {
- STRLEN keylen;
- const char * const key = SvPV_const(keysv, keylen);
- SAVEDELETE(hv, savepvn(key,keylen),
- SvUTF8(keysv) ? -(I32)keylen : (I32)keylen);
- }
- }
+ else if (preeminent)
+ save_helem_flags(hv, keysv, svp,
+ (PL_op->op_flags & OPf_SPECIAL) ? 0 : SAVEf_SETMAGIC);
+ else
+ SAVEHDELETE(hv, keysv);
}
}
*MARK = svp ? *svp : &PL_sv_undef;
diff --git a/pp_hot.c b/pp_hot.c
index 7afa42225a..8416eeef6b 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1823,16 +1823,11 @@ PP(pp_helem)
if (localizing) {
if (HvNAME_get(hv) && isGV(*svp))
save_gp(MUTABLE_GV(*svp), !(PL_op->op_flags & OPf_SPECIAL));
- else {
- if (!preeminent) {
- STRLEN keylen;
- const char * const key = SvPV_const(keysv, keylen);
- SAVEDELETE(hv, savepvn(key,keylen),
- SvUTF8(keysv) ? -(I32)keylen : (I32)keylen);
- } else
- save_helem_flags(hv, keysv, svp,
- (PL_op->op_flags & OPf_SPECIAL) ? 0 : SAVEf_SETMAGIC);
- }
+ else if (preeminent)
+ save_helem_flags(hv, keysv, svp,
+ (PL_op->op_flags & OPf_SPECIAL) ? 0 : SAVEf_SETMAGIC);
+ else
+ SAVEHDELETE(hv, keysv);
}
else if (PL_op->op_private & OPpDEREF)
vivify_ref(*svp, PL_op->op_private & OPpDEREF);