summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-11-18 15:12:02 -0700
committerKarl Williamson <khw@cpan.org>2018-11-26 22:24:33 -0700
commit5bac62cf21849bc59401425b51eaffd56e878a6e (patch)
tree2a233a24ef74b74980b4b1e7b65bd028072c9ca9 /regexec.c
parentc4ead7708a7283c887e9bdc266dc06135def9671 (diff)
downloadperl-5bac62cf21849bc59401425b51eaffd56e878a6e.tar.gz
regexec.c: Expand out macro in only remaining use
There is only one call to this macro. It's easier to understand if expanded out instead of the call. The next commit will refactor.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/regexec.c b/regexec.c
index 9dbaeaad1f..582b031064 100644
--- a/regexec.c
+++ b/regexec.c
@@ -107,13 +107,6 @@ static const char* const non_utf8_target_but_utf8_required
#define STATIC static
#endif
-/* Valid only if 'c', the character being looke-up, is an invariant under
- * UTF-8: it avoids the reginclass call if there are no complications: i.e., if
- * everything matchable is straight forward in the bitmap */
-#define REGINCLASS(prog,p,c,u) (ANYOF_FLAGS(p) \
- ? reginclass(prog,p,c,c+1,u) \
- : ANYOF_BITMAP_TEST(p,*(c)))
-
/*
* Forwards.
*/
@@ -6714,7 +6707,9 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
locinput += UTF8SKIP(locinput);
}
else {
- if (!REGINCLASS(rex, scan, (U8*)locinput, utf8_target))
+ if (ANYOF_FLAGS(scan)
+ ? ! reginclass(rex, scan, (U8*) locinput, (U8*) locinput+1, utf8_target)
+ : ! ANYOF_BITMAP_TEST(scan, *(U8*) locinput))
sayNO;
locinput++;
}