d35ea2
From bd5fa06648085e8c17efd55abeb6424aeeb1018e Mon Sep 17 00:00:00 2001
d35ea2
From: Karl Williamson <khw@cpan.org>
d35ea2
Date: Tue, 29 Sep 2020 00:48:19 -0600
d35ea2
Subject: [PATCH] Remove Perl_av_top_index
d35ea2
MIME-Version: 1.0
d35ea2
Content-Type: text/plain; charset=UTF-8
d35ea2
Content-Transfer-Encoding: 8bit
d35ea2
d35ea2
I created this in 87306e0674dfe3af29804b4641347cd5ac9b0521, thinking it
d35ea2
was needed to preserve backward compatibility if someone were using this
d35ea2
instead of the macro.  But it turned out that there never was such a
d35ea2
function, it was inlined, and the name was S_av_top_index, so there is
d35ea2
no reason to create a new function that no one has ever been able to
d35ea2
call.  So just remove it, and let all accesses go through the macro
d35ea2
d35ea2
Signed-off-by: Petr Písař <ppisar@redhat.com>
d35ea2
---
d35ea2
 av.c      | 10 ----------
d35ea2
 embed.fnc |  2 +-
d35ea2
 proto.h   |  7 +++----
d35ea2
 3 files changed, 4 insertions(+), 15 deletions(-)
d35ea2
d35ea2
diff --git a/av.c b/av.c
d35ea2
index ada09cde9a..ad2429f90d 100644
d35ea2
--- a/av.c
d35ea2
+++ b/av.c
d35ea2
@@ -1095,16 +1095,6 @@ Perl_av_nonelem(pTHX_ AV *av, SSize_t ix) {
d35ea2
     return sv;
d35ea2
 }
d35ea2
 
d35ea2
-SSize_t
d35ea2
-Perl_av_top_index(pTHX_ AV *av)
d35ea2
-{
d35ea2
-    PERL_ARGS_ASSERT_AV_TOP_INDEX;
d35ea2
-    assert(SvTYPE(av) == SVt_PVAV);
d35ea2
-
d35ea2
-    return AvFILL(av);
d35ea2
-}
d35ea2
-
d35ea2
-
d35ea2
 /*
d35ea2
  * ex: set ts=8 sts=4 sw=4 et:
d35ea2
  */
d35ea2
diff --git a/embed.fnc b/embed.fnc
d35ea2
index a6b4d0350f..f5c5b29c2d 100644
d35ea2
--- a/embed.fnc
d35ea2
+++ b/embed.fnc
d35ea2
@@ -637,7 +637,7 @@ Apd	|void	|av_push	|NN AV *av|NN SV *val
d35ea2
 EXp	|void	|av_reify	|NN AV *av
d35ea2
 ApdR	|SV*	|av_shift	|NN AV *av
d35ea2
 Apd	|SV**	|av_store	|NN AV *av|SSize_t key|NULLOK SV *val
d35ea2
-AMdRp	|SSize_t|av_top_index	|NN AV *av
d35ea2
+AmdR	|SSize_t|av_top_index	|NN AV *av
d35ea2
 AidRp	|Size_t	|av_count	|NN AV *av
d35ea2
 AmdR	|SSize_t|av_tindex	|NN AV *av
d35ea2
 Apd	|void	|av_undef	|NN AV *av
d35ea2
diff --git a/proto.h b/proto.h
d35ea2
index c4490fc46e..2da1a07761 100644
d35ea2
--- a/proto.h
d35ea2
+++ b/proto.h
d35ea2
@@ -291,10 +291,9 @@ PERL_CALLCONV SV**	Perl_av_store(pTHX_ AV *av, SSize_t key, SV *val);
d35ea2
 			__attribute__warn_unused_result__; */
d35ea2
 #define PERL_ARGS_ASSERT_AV_TINDEX
d35ea2
 
d35ea2
-PERL_CALLCONV SSize_t	Perl_av_top_index(pTHX_ AV *av)
d35ea2
-			__attribute__warn_unused_result__;
d35ea2
-#define PERL_ARGS_ASSERT_AV_TOP_INDEX	\
d35ea2
-	assert(av)
d35ea2
+/* PERL_CALLCONV SSize_t	av_top_index(pTHX_ AV *av)
d35ea2
+			__attribute__warn_unused_result__; */
d35ea2
+#define PERL_ARGS_ASSERT_AV_TOP_INDEX
d35ea2
 
d35ea2
 PERL_CALLCONV void	Perl_av_undef(pTHX_ AV *av);
d35ea2
 #define PERL_ARGS_ASSERT_AV_UNDEF	\
d35ea2
-- 
d35ea2
2.25.4
d35ea2