diff options
author | Nicholas Clark <nick@ccl4.org> | 2021-07-20 20:05:44 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2021-07-26 07:06:00 +0000 |
commit | 5ebe3ee8a2e8df14624495256026a546dbf8c1dc (patch) | |
tree | 428ae8a07eda7f01ec8814510cc9edb67b72eca7 /hv.h | |
parent | bffed14d6aeedc70a2f799ef7c8fe1f5d608eb52 (diff) | |
download | perl-5ebe3ee8a2e8df14624495256026a546dbf8c1dc.tar.gz |
Convert code in mro_core.c to use hv_*hek() APIs where possible.
Add a macro hv_existshek() to implement exists.
The HEK-based macros are more efficient wrappers of hv_common() than the
string/length/flags macros because they also pass in the pre-computed hash
value (from the HEK). This avoids hv_common() needing to recalculate it.
Diffstat (limited to 'hv.h')
-rw-r--r-- | hv.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -533,6 +533,9 @@ See L</hv_fill>. # define hv_deletehek(hv, hek, flags) \ hv_common((hv), NULL, HEK_KEY(hek), HEK_LEN(hek), HEK_UTF8(hek), \ (flags)|HV_DELETE, NULL, HEK_HASH(hek)) +#define hv_existshek(hv, hek) \ + cBOOL(hv_common((hv), NULL, HEK_KEY(hek), HEK_LEN(hek), HEK_UTF8(hek), \ + HV_FETCH_ISEXISTS, NULL, HEK_HASH(hek))) #endif /* This refcounted he structure is used for storing the hints used for lexical |