diff options
author | David Mitchell <davem@iabyn.com> | 2016-08-17 11:18:46 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2016-08-17 13:38:56 +0100 |
commit | 11b62bc4c2460b23807b5c84c6e8b463068cf886 (patch) | |
tree | 014a408b371c050ab1011369833ef82f0a6fcc13 /av.c | |
parent | 93a3e97518c1f1e5d6916e1550a36f0d39d520e6 (diff) | |
download | perl-11b62bc4c2460b23807b5c84c6e8b463068cf886.tar.gz |
av_fetch(): sprinkle UNLIKELY()
Diffstat (limited to 'av.c')
-rw-r--r-- | av.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; |