From 9d1dc8e3bf4c4286d3d098f35f83be5d6c34478a Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 26 Aug 2021 10:34:59 +0000 Subject: Delete the macro XHvTOTALKEYS() which is unused and not in the API. XHvTOTALKEYS() was added in Dec 2001 as part of commit 8aacddc1ea3837f8: Tidied version of Jeffrey Friedl's restricted hashes - added delete of READONLY value inhibit & test for same - re-tabbed It's not part of the API, and not used by any code on CPAN. The last (and only) direct use was in Perl_hv_clear_placeholders(), and that was converted to HvTOTALKEYS() in May 2005 as part of commit 5d88ecd7e75b7174: Various HvPLACEHOLDERS() that should be HvPLACEHOLDERS_get() Hence "inline" the macro XHvTOTALKEYS() into the macro HvTOTALKEYS(), eliminating the only use of XHvTOTALKEYS(). --- hv.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'hv.h') diff --git a/hv.h b/hv.h index a43b9611bb..911a054a75 100644 --- a/hv.h +++ b/hv.h @@ -333,9 +333,6 @@ See L. ((SvOOK(hv) && HvAUX(hv)->xhv_name_u.xhvnameu_name && HvAUX(hv)->xhv_name_count != -1) \ ? HEK_UTF8(HvENAME_HEK_NN(hv)) : 0) -/* the number of keys (including any placeholders) - NOT PART OF THE API */ -#define XHvTOTALKEYS(xhv) ((xhv)->xhv_keys) - /* * HvKEYS gets the number of keys that actually exist(), and is provided * for backwards compatibility with old XS code. The core uses HvUSEDKEYS @@ -343,7 +340,7 @@ See L. */ #define HvKEYS(hv) HvUSEDKEYS(hv) #define HvUSEDKEYS(hv) (HvTOTALKEYS(hv) - HvPLACEHOLDERS_get(hv)) -#define HvTOTALKEYS(hv) XHvTOTALKEYS((XPVHV*) SvANY(hv)) +#define HvTOTALKEYS(hv) (((XPVHV*) SvANY(hv))->xhv_keys) #define HvPLACEHOLDERS(hv) (*Perl_hv_placeholders_p(aTHX_ MUTABLE_HV(hv))) #define HvPLACEHOLDERS_get(hv) (SvMAGIC(hv) ? Perl_hv_placeholders_get(aTHX_ (const HV *)hv) : 0) #define HvPLACEHOLDERS_set(hv,p) Perl_hv_placeholders_set(aTHX_ MUTABLE_HV(hv), p) -- cgit v1.2.1