From 5983026606b07a11e381fbd9fca44a9e1fa7d497 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 21 Oct 2021 18:53:01 +0000 Subject: Drop the unused hv argument from S_hv_free_ent_ret() In turn, this means that the hv argument to Perl_hv_free_ent() and Perl_hv_delayfree_ent() is now clearly unused, so mark it as such. Both functions are deemed to be API, so unlike the static function S_hv_free_ent_ret we can't simply change their parameters. However, change all the internal callers to pass NULL instead of the hv, as this makes it obvious that the function does not read hv, and might cause the compiler to generate better code. --- pp_sys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pp_sys.c') diff --git a/pp_sys.c b/pp_sys.c index db266879bf..4cbe323ec5 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -874,7 +874,7 @@ PP(pp_tie) methname = "TIEHASH"; if (HvLAZYDEL(varsv) && (entry = HvEITER_get((HV *)varsv))) { HvLAZYDEL_off(varsv); - hv_free_ent((HV *)varsv, entry); + hv_free_ent(NULL, entry); } HvEITER_set(MUTABLE_HV(varsv), 0); HvRITER_set(MUTABLE_HV(varsv), -1); @@ -1036,7 +1036,7 @@ PP(pp_untie) HE *entry; if (HvLAZYDEL(sv) && (entry = HvEITER_get((HV *)sv))) { HvLAZYDEL_off(sv); - hv_free_ent((HV *)sv, entry); + hv_free_ent(NULL, entry); HvEITER_set(MUTABLE_HV(sv), 0); } } -- cgit v1.2.1