diff options
author | Karl Williamson <khw@cpan.org> | 2016-02-10 14:13:10 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2016-02-10 21:16:44 -0700 |
commit | e29d83e275fddfa5dff93b81c390faeb10b4bf17 (patch) | |
tree | b8322d59f47c9433b830f926bad5fc25230ba55c /regexec.c | |
parent | 5b6be8ee92f615137555abea6248b4e39f12862a (diff) | |
download | perl-e29d83e275fddfa5dff93b81c390faeb10b4bf17.tar.gz |
regexec.c: Skip duplicate work
By changing the fallthrough of a case of a switch to a goto we can avoid
re-executing the test that was just done.
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -6183,7 +6183,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog) } to_complement = 1; - /* FALLTHROUGH */ + goto join_nposixa; case POSIXA: /* \w or [:punct:] etc. under /a */ @@ -6192,9 +6192,14 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog) * UTF-8, and also from NPOSIXA even in UTF-8 when the current * character is a single byte */ - if (NEXTCHR_IS_EOS - || ! (to_complement ^ cBOOL(_generic_isCC_A(nextchr, - FLAGS(scan))))) + if (NEXTCHR_IS_EOS) { + sayNO; + } + + join_nposixa: + + if (! (to_complement ^ cBOOL(_generic_isCC_A(nextchr, + FLAGS(scan))))) { sayNO; } |