summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-05-21 11:40:24 -0600
committerKarl Williamson <khw@cpan.org>2021-08-07 14:50:36 -0600
commite1458615503a7ee9dc3f510d6942741099f96de7 (patch)
tree8c0a20d94f1299f60057df71a9cdd604f6a46a12 /regcomp.c
parentf65d7dd20f5be654b42cd1ab8a9e57c24bd0c8d7 (diff)
downloadperl-e1458615503a7ee9dc3f510d6942741099f96de7.tar.gz
regcomp.c: Save a value instead of re-calling fcn
This variable will be used in future commits in more places, so compute it just once.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/regcomp.c b/regcomp.c
index 14d5b3c2b5..f8a0d876c5 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -19326,7 +19326,7 @@ S_optimize_regclass(pTHX_
UV start[MAX_FOLD_FROMS+1] = { 0 }; /* +1 for the folded-to char */
UV end[MAX_FOLD_FROMS+1] = { 0 };
bool single_range = FALSE;
- UV lowest_cp = 0;
+ UV lowest_cp = 0, highest_cp = 0;
PERL_ARGS_ASSERT_OPTIMIZE_REGCLASS;
@@ -19360,6 +19360,8 @@ S_optimize_regclass(pTHX_
/* Use a clearer mnemonic for below */
lowest_cp = start[0];
+
+ highest_cp = invlist_highest(cp_list);
}
/* Similarly, for /l posix classes, if both a class and its complement
@@ -19824,7 +19826,7 @@ S_optimize_regclass(pTHX_
/* If doesn't fit the criteria for ANYOFM, invert and try again. If
* that works we will instead later generate an NANYOFM, and invert
* back when through */
- if (invlist_highest(cp_list) > max_permissible) {
+ if (highest_cp > max_permissible) {
_invlist_invert(cp_list);
inverted = 1;
}