diff options
author | Vincent Pit <perl@profvince.com> | 2009-07-25 18:24:31 +0200 |
---|---|---|
committer | Vincent Pit <perl@profvince.com> | 2009-07-25 23:26:07 +0200 |
commit | 47cfc530daffd82ce559257488607278cf379aa8 (patch) | |
tree | ca57b33e57f049aa15c250149d00870360bec57d | |
parent | af097752b446f87855473ee776be3a2d7b735986 (diff) | |
download | perl-47cfc530daffd82ce559257488607278cf379aa8.tar.gz |
Use the new SAVEHDELETE() macro wherever possible
-rw-r--r-- | pp.c | 16 | ||||
-rw-r--r-- | pp_hot.c | 15 |
2 files changed, 10 insertions, 21 deletions
@@ -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; @@ -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); |