summaryrefslogtreecommitdiff
path: root/av.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-02-07 11:43:02 -0700
committerKarl Williamson <public@khwilliamson.com>2013-02-08 14:44:24 -0700
commitdab460cdc878907f9f3f36b96709f818ac937409 (patch)
treedf2722f0718536486e11c6afadef2d508e3d67eb /av.c
parent2dbb0a307f0954c1222fc47c920f695d0b1db80d (diff)
downloadperl-dab460cdc878907f9f3f36b96709f818ac937409.tar.gz
Change name 'av_top' to 'av_top_index'
In using the av_top() function created in a recent commit, I found myself being confused, and thinking it meant the top element of the array, whereas it really means the index of the top element of that array. Since the new name has not appeared in a stable release, it can be changed, without remorse, to include 'index' in it.
Diffstat (limited to 'av.c')
-rw-r--r--av.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/av.c b/av.c
index 9f08212d0a..18fa3c3f5d 100644
--- a/av.c
+++ b/av.c
@@ -759,16 +759,16 @@ Perl_av_shift(pTHX_ AV *av)
}
/*
-=for apidoc av_top
+=for apidoc av_top_index
Returns the highest index in the array. The number of elements in the
-array is C<av_top(av) + 1>. Returns -1 if the array is empty.
+array is C<av_top_index(av) + 1>. Returns -1 if the array is empty.
The Perl equivalent for this is C<$#myarray>.
=for apidoc av_len
-Same as L</av_top>. Returns the highest index in the array. Note that the
+Same as L</av_top_index>. Returns the highest index in the array. Note that the
return value is +1 what its name implies it returns; and hence differs in
meaning from what the similarly named L</sv_len> returns.
@@ -778,7 +778,7 @@ meaning from what the similarly named L</sv_len> returns.
I32
Perl_av_len(pTHX_ AV *av)
{
- /* If change this, must change identical Perl_av_top() just below */
+ /* If change this, must change identical Perl_av_top_index() just below */
PERL_ARGS_ASSERT_AV_LEN;
assert(SvTYPE(av) == SVt_PVAV);
@@ -787,12 +787,12 @@ Perl_av_len(pTHX_ AV *av)
}
I32
-Perl_av_top(pTHX_ AV *av)
+Perl_av_top_index(pTHX_ AV *av)
{
/* So short, that it is just a duplicate of Perl_av_len(). Must keep them
* in sync */
- PERL_ARGS_ASSERT_AV_TOP;
+ PERL_ARGS_ASSERT_AV_TOP_INDEX;
assert(SvTYPE(av) == SVt_PVAV);
return AvFILL(av);