This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
96e6a0b
)
av_fetch(): use AvFILLp rather than AvFILL
author
David Mitchell
<davem@iabyn.com>
Wed, 17 Aug 2016 08:52:48 +0000
(09:52 +0100)
committer
David Mitchell
<davem@iabyn.com>
Wed, 17 Aug 2016 12:38:56 +0000
(13:38 +0100)
The point in the code which uses AvFILL will never be reached if the array
is tied, so use AvFILLp insead, which directly accesses the xav_fill
field.
This only affects the $a[-N] branch: the $a[+N] branch already uses
AvFILLp().
av.c
patch
|
blob
|
blame
|
history
diff --git
a/av.c
b/av.c
index
2f81971
..
a48702b
100644
(file)
--- a/
av.c
+++ b/
av.c
@@
-269,7
+269,7
@@
Perl_av_fetch(pTHX_ AV *av, SSize_t key, I32 lval)
}
if (key < 0) {
- key += AvFILL(av) + 1;
+ key += AvFILL
p
(av) + 1;
if (key < 0)
return NULL;
}