Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use IndexOfAny{Except}InRange in RegexCompiler / source generator #76859

Merged
merged 2 commits into from
Oct 27, 2022

Commits on Oct 26, 2022

  1. Use IndexOfAny{Except}InRange in RegexCompiler / source generator

    This augments our existing use of IndexOf, IndexOfAny, and IndexOfAnyExcept to also support IndexOfAnyInRange and IndexOfAnyExceptInRange.  That means, for example, we can now efficiently find the start of a pattern like `[0-9]{5}`, via a vectorized search, whereas previously it'd require iterating character by character in a scalar loop.
    
    As part of this, I changed some tuples to instead be named structs.  They were becoming unwieldy, and we expect we'll be adding even more here as additional IndexOf variants become available.
    stephentoub committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    b344c01 View commit details
    Browse the repository at this point in the history
  2. Address PR feedback

    And add a bit more test coverage
    stephentoub committed Oct 26, 2022
    Configuration menu
    Copy the full SHA
    2036504 View commit details
    Browse the repository at this point in the history