summaryrefslogtreecommitdiff
path: root/hv.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-10-27 06:35:35 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-10-28 16:15:09 -0700
commit0ca9877d08d37b8bc87c72cc832142c90f929378 (patch)
tree6679beb57c25035ffb0fcb4d4730fba146d85a16 /hv.h
parent4639d557ab77c475c9938688efe6b61bedcecf8b (diff)
downloadperl-0ca9877d08d37b8bc87c72cc832142c90f929378.tar.gz
When deleting via hek, pass the computed hash value
In those cases where the hash key comes from a hek, we already have a computed hash value, so pass that to hv_common. The easiest way to accomplish this is to add a new macro.
Diffstat (limited to 'hv.h')
-rw-r--r--hv.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/hv.h b/hv.h
index fa13a84230..d5632be03c 100644
--- a/hv.h
+++ b/hv.h
@@ -470,6 +470,12 @@ C<SV*>.
(MUTABLE_SV(hv_common_key_len((hv), (key), (klen), \
(flags) | HV_DELETE, NULL, 0)))
+#ifdef PERL_CORE
+# 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))
+#endif
+
/* This refcounted he structure is used for storing the hints used for lexical
pragmas. Without threads, it's basically struct he + refcount.
With threads, life gets more complex as the structure needs to be shared