This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regmatch(): use nextchar where available
authorDavid Mitchell <davem@iabyn.com>
Fri, 14 Sep 2012 10:28:08 +0000 (11:28 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 26 Sep 2012 08:41:09 +0000 (09:41 +0100)
In a couple of places the code was using *locinput, where
nextchar already equalled *locinput

regexec.c

index f207cda..d606238 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -3412,7 +3412,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
             /* In this case the charclass data is available inline so
                we can fail fast without a lot of extra overhead. 
              */
-            if(!ANYOF_BITMAP_TEST(scan, *locinput)) {
+            if(!ANYOF_BITMAP_TEST(scan, nextchr)) {
                 DEBUG_EXECUTE_r(
                     PerlIO_printf(Perl_debug_log,
                               "%*s  %sfailed to match trie start class...%s\n",
@@ -3477,7 +3477,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
                HV * widecharmap = MUTABLE_HV(rexi->data->data[ ARG( scan ) + 1 ]);
                 U32 state = trie->startstate;
 
-                if (trie->bitmap && !TRIE_BITMAP_TEST(trie,*locinput) ) {
+                if (trie->bitmap && !TRIE_BITMAP_TEST(trie, nextchr) ) {
                    if (trie->states[ state ].wordnum) {
                         DEBUG_EXECUTE_r(
                             PerlIO_printf(Perl_debug_log,