summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2021-05-18 12:04:37 -0600
committerKarl Williamson <khw@cpan.org>2021-08-07 14:50:35 -0600
commit138daa9de5910dbd89190c9345fb07a0efbb5860 (patch)
tree489677d3cc7f282a4a7f4a615e8d914b37cdc855 /regcomp.c
parent320ae5fef6390c701c0fb885b5a5109ee65ce350 (diff)
downloadperl-138daa9de5910dbd89190c9345fb07a0efbb5860.tar.gz
regcomp.c: Add some branch predictors
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/regcomp.c b/regcomp.c
index 98b83f7d0c..edcb9e44d0 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -9517,7 +9517,7 @@ Perl__invlist_search(SV* const invlist, const UV cp)
PERL_ARGS_ASSERT__INVLIST_SEARCH;
/* If list is empty, return failure. */
- if (high == 0) {
+ if (UNLIKELY(high == 0)) {
return -1;
}
@@ -9526,7 +9526,7 @@ Perl__invlist_search(SV* const invlist, const UV cp)
mid = invlist_previous_index(invlist);
assert(mid >=0);
- if (mid > highest_element) {
+ if (UNLIKELY(mid > highest_element)) {
mid = highest_element;
}