diff options
author | Nicholas Clark <nick@ccl4.org> | 2013-02-22 11:19:17 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2013-02-26 16:00:20 +0100 |
commit | 81a3ba357619262f575c515f93150c2249869e2b (patch) | |
tree | 72048f9a5d984f278f33645a5155032cba581e3a /hv.c | |
parent | 1eaee7845e76896a17ec115591f88c45e0d8302d (diff) | |
download | perl-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |