Small tidy to start of match optimizations.

This commit is contained in:
Philip.Hazel 2018-01-01 15:05:27 +00:00
parent 807f37095d
commit 4048606896
2 changed files with 14 additions and 0 deletions

View File

@ -3522,6 +3522,12 @@ for (;;)
if ((start_bits[c/8] & (1 << (c&7))) != 0) break; if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
start_match++; start_match++;
} }
/* See comment above in first_cu checking about the next line. */
if ((mb->moptions & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) == 0 &&
start_match >= mb->end_subject)
break;
} }
} /* End of first code unit handling */ } /* End of first code unit handling */

View File

@ -6526,6 +6526,14 @@ for(;;)
if ((start_bits[c/8] & (1 << (c&7))) != 0) break; if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
start_match++; start_match++;
} }
/* See comment above in first_cu checking about the next few lines. */
if (!mb->partial && start_match >= mb->end_subject)
{
rc = MATCH_NOMATCH;
break;
}
} }
} /* End first code unit handling */ } /* End first code unit handling */