summaryrefslogtreecommitdiff
path: root/av.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2016-08-17 11:18:46 +0100
committerDavid Mitchell <davem@iabyn.com>2016-08-17 13:38:56 +0100
commit11b62bc4c2460b23807b5c84c6e8b463068cf886 (patch)
tree014a408b371c050ab1011369833ef82f0a6fcc13 /av.c
parent93a3e97518c1f1e5d6916e1550a36f0d39d520e6 (diff)
downloadperl-11b62bc4c2460b23807b5c84c6e8b463068cf886.tar.gz
av_fetch(): sprinkle UNLIKELY()
Diffstat (limited to 'av.c')
-rw-r--r--av.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/av.c b/av.c
index 8967da5703..549ca6c86e 100644
--- a/av.c
+++ b/av.c
@@ -247,7 +247,7 @@ Perl_av_fetch(pTHX_ AV *av, SSize_t key, I32 lval)
PERL_ARGS_ASSERT_AV_FETCH;
assert(SvTYPE(av) == SVt_PVAV);
- if (SvRMAGICAL(av)) {
+ if (UNLIKELY(SvRMAGICAL(av))) {
const MAGIC * const tied_magic
= mg_find((const SV *)av, PERL_MAGIC_tied);
if (tied_magic || mg_find((const SV *)av, PERL_MAGIC_regdata)) {
@@ -270,7 +270,7 @@ Perl_av_fetch(pTHX_ AV *av, SSize_t key, I32 lval)
if (key < 0) {
key += AvFILLp(av) + 1;
- if (key < 0)
+ if (UNLIKELY(key < 0))
return NULL;
assert(key <= AvFILLp(av));
if (!AvARRAY(av)[key])
@@ -281,7 +281,7 @@ Perl_av_fetch(pTHX_ AV *av, SSize_t key, I32 lval)
return lval ? av_store(av,key,newSV(0)) : NULL;
}
- if (AvREIFY(av) && SvIS_FREED(AvARRAY(av)[key])) {
+ if (UNLIKELY(AvREIFY(av) && SvIS_FREED(AvARRAY(av)[key]))) {
/* eg. @_ could have freed elts */
AvARRAY(av)[key] = NULL; /* 1/2 reify */
goto emptyness;