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

Improve code generated for starts_with(<literal char>) #67249

Merged
merged 4 commits into from
Dec 16, 2019

Commits on Dec 11, 2019

  1. Improve str prefix/suffix comparison

    The comparison can be performed on the raw bytes, as the chars can
    only match if their UTF8 encoding matches.
    
    This avoids the `is_char_boundary` checks and translates to a straight
    `u8` slice comparison which is optimized to a memcmp or inline
    comparison where appropriate.
    ranma42 committed Dec 11, 2019
    Configuration menu
    Copy the full SHA
    cc863f0 View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2019

  1. Prefer encoding the char when checking for string prefix/suffix

    This enables constant folding when matching a literal char.
    
    Fixes rust-lang#41993.
    ranma42 committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    1f6d023 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    de7fefa View commit details
    Browse the repository at this point in the history

Commits on Dec 16, 2019

  1. Configuration menu
    Copy the full SHA
    3de1923 View commit details
    Browse the repository at this point in the history