summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2015-12-26 12:35:32 -0700
committerKarl Williamson <khw@cpan.org>2015-12-26 12:57:41 -0700
commitc286c389b9042dbcef4d300c4faacf7efc8f6e75 (patch)
tree1ecc8d82b21b9784e3cd45642177da5b324f1a95 /regexec.c
parent428c1aff5a0e12f06706ffce0a395e4123d8965e (diff)
downloadperl-c286c389b9042dbcef4d300c4faacf7efc8f6e75.tar.gz
regexec.c: Avoid a function call
Not infrequently, a UTF-8 string will contain ASCII. In this case, by adding a test for this we can avoid the function call that is needed for more complicated cases.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/regexec.c b/regexec.c
index 170e63ec18..0e95676f42 100644
--- a/regexec.c
+++ b/regexec.c
@@ -5775,7 +5775,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
case ANYOF: /* /[abc]/ */
if (NEXTCHR_IS_EOS)
sayNO;
- if (utf8_target) {
+ if (utf8_target && ! UTF8_IS_INVARIANT(locinput)) {
if (!reginclass(rex, scan, (U8*)locinput, (U8*)reginfo->strend,
utf8_target))
sayNO;