diff options
author | Karl Williamson <khw@cpan.org> | 2018-11-18 15:24:45 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-11-26 22:24:33 -0700 |
commit | 5b864157a512a368408bbffe50b594a639cba56a (patch) | |
tree | 5f51ed06c263acbe67cdc06655412c9cf388ead4 | |
parent | 5bac62cf21849bc59401425b51eaffd56e878a6e (diff) | |
download | perl-5b864157a512a368408bbffe50b594a639cba56a.tar.gz |
regexec.c: Refactor expanded macro from prev. commit
-rw-r--r-- | regexec.c | 23 |
1 files changed, 13 insertions, 10 deletions
@@ -6700,19 +6700,22 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog) case ANYOF: /* /[abc]/ */ if (NEXTCHR_IS_EOS) sayNO; - if (utf8_target && ! UTF8_IS_INVARIANT(*locinput)) { + if ( (! utf8_target || UTF8_IS_INVARIANT(*locinput)) + && ! ANYOF_FLAGS(scan)) + { + if (! ANYOF_BITMAP_TEST(scan, * (U8 *) (locinput))) { + sayNO; + } + locinput++; + } + else { if (!reginclass(rex, scan, (U8*)locinput, (U8*)reginfo->strend, utf8_target)) + { sayNO; - locinput += UTF8SKIP(locinput); - } - else { - if (ANYOF_FLAGS(scan) - ? ! reginclass(rex, scan, (U8*) locinput, (U8*) locinput+1, utf8_target) - : ! ANYOF_BITMAP_TEST(scan, *(U8*) locinput)) - sayNO; - locinput++; - } + } + goto increment_locinput; + } break; case ANYOFM: |