summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2014-03-10 12:29:56 +0000
committerDavid Mitchell <davem@iabyn.com>2014-03-10 12:29:56 +0000
commit5d27ee4af18b0f3857a1f951f91473c86da29b62 (patch)
tree3fffd7c64edcf05e2583b122301c1880ecc50514 /hv.c
parent6e2e048be95a027035f83c0f673f8de94e013c87 (diff)
downloadperl-5d27ee4af18b0f3857a1f951f91473c86da29b62.tar.gz
don't repeatedly call HvUSEDKEYS
HvUSEDKEYS contains a function call nowadays. Don't call it repeatedly.
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hv.c b/hv.c
index 91d4c39fa9..9d80659853 100644
--- a/hv.c
+++ b/hv.c
@@ -1625,8 +1625,10 @@ S_clear_placeholders(pTHX_ HV *hv, U32 items)
if (--items == 0) {
/* Finished. */
- HvTOTALKEYS(hv) -= (IV)HvPLACEHOLDERS_get(hv);
- if (HvUSEDKEYS(hv) == 0)
+ I32 placeholders = HvPLACEHOLDERS_get(hv);
+ HvTOTALKEYS(hv) -= (IV)placeholders;
+ /* HvUSEDKEYS expanded */
+ if ((HvTOTALKEYS(hv) - placeholders) == 0)
HvHASKFLAGS_off(hv);
HvPLACEHOLDERS_set(hv, 0);
return;