summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2013-02-22 11:19:17 +0100
committerNicholas Clark <nick@ccl4.org>2013-02-26 16:00:20 +0100
commit81a3ba357619262f575c515f93150c2249869e2b (patch)
tree72048f9a5d984f278f33645a5155032cba581e3a /hv.c
parent1eaee7845e76896a17ec115591f88c45e0d8302d (diff)
downloadperl-81a3ba357619262f575c515f93150c2249869e2b.tar.gz
In Perl_hv_common(), call S_clear_placeholders() directly.
This saves one call to HvPLACEHOLDERS_get().
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hv.c b/hv.c
index 33387dc2de..809bd00e3a 100644
--- a/hv.c
+++ b/hv.c
@@ -797,8 +797,9 @@ Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
xhv->xhv_keys++; /* HvTOTALKEYS(hv)++ */
if ( DO_HSPLIT(xhv) ) {
const STRLEN oldsize = xhv->xhv_max + 1;
+ const U32 items = (U32)HvPLACEHOLDERS_get(hv);
- if (HvPLACEHOLDERS_get(hv) /* hash has placeholders */
+ if (items /* hash has placeholders */
&& !SvREADONLY(hv) /* but is not a restricted hash */) {
/* If this hash previously was a "restricted hash" and had
placeholders, but the "restricted" flag has been turned off,
@@ -810,7 +811,7 @@ Perl_hv_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
readonly flag, because Storable always pre-splits the hash.
If we're lucky, then we may clear sufficient placeholders to
avoid needing to split the hash at all. */
- hv_clear_placeholders(hv);
+ clear_placeholders(hv, items);
if (DO_HSPLIT(xhv))
hsplit(hv, oldsize, oldsize * 2);
} else