summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-02-10 14:13:10 -0700
committerKarl Williamson <khw@cpan.org>2016-02-10 21:16:44 -0700
commite29d83e275fddfa5dff93b81c390faeb10b4bf17 (patch)
treeb8322d59f47c9433b830f926bad5fc25230ba55c /regexec.c
parent5b6be8ee92f615137555abea6248b4e39f12862a (diff)
downloadperl-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.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/regexec.c b/regexec.c
index 2d8daba270..f4431139a5 100644
--- a/regexec.c
+++ b/regexec.c
@@ -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;
}