summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-04-03 10:30:38 -0600
committerKarl Williamson <khw@cpan.org>2020-10-16 07:01:41 -0600
commit95f5a9192aec499cfcb88b39a66919cc67ed6c7d (patch)
tree03b5a74eabfbac05573260e05ced8514473cffd4 /regexec.c
parent938090acbdbd9475a044786f75bbbcf4e64d3b49 (diff)
downloadperl-95f5a9192aec499cfcb88b39a66919cc67ed6c7d.tar.gz
regcomp.c,regexec.c: Simplify
This commit uses the new macros from the previous commit to simply come code.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/regexec.c b/regexec.c
index ec686dafcd..ca2dc4ea23 100644
--- a/regexec.c
+++ b/regexec.c
@@ -4522,20 +4522,14 @@ S_setup_EXACTISH_ST_c1_c2(pTHX_ const regnode * const text_node, int *c1p,
U8 *pat = (U8*)STRING(text_node);
U8 folded[UTF8_MAX_FOLD_CHAR_EXPAND * UTF8_MAXBYTES_CASE + 1] = { '\0' };
- if ( OP(text_node) == EXACT
- || OP(text_node) == LEXACT
- || OP(text_node) == EXACT_REQ8
- || OP(text_node) == LEXACT_REQ8
- || OP(text_node) == EXACTL)
- {
+ if (! isEXACTFish(OP(text_node))) {
/* In an exact node, only one thing can be matched, that first
* character. If both the pat and the target are UTF-8, we can just
* copy the input to the output, avoiding finding the code point of
* that character */
if (!is_utf8_pat) {
- assert( OP(text_node) != EXACT_REQ8
- && OP(text_node) != LEXACT_REQ8);
+ assert(! isEXACT_REQ8(OP(text_node)));
c2 = c1 = *pat;
}
else if (utf8_target) {
@@ -4543,9 +4537,7 @@ S_setup_EXACTISH_ST_c1_c2(pTHX_ const regnode * const text_node, int *c1p,
Copy(pat, c2_utf8, UTF8SKIP(pat), U8);
utf8_has_been_setup = TRUE;
}
- else if ( OP(text_node) == EXACT_REQ8
- || OP(text_node) == LEXACT_REQ8)
- {
+ else if (isEXACT_REQ8(OP(text_node))) {
return FALSE; /* Can only match UTF-8 target */
}
else {