Merged
Conversation
Branchless ASCII case-insensitive comparison using the (x | 0x20) lowering trick with unsigned underflow for range check. https://claude.ai/code/session_01YTKHy6Dzb84sH6hyxVEDXz
Delegate to to_ascii_lowercase() instead of inline bit manipulation, matching Rust stdlib's char::eq_ignore_ascii_case exactly. https://claude.ai/code/session_01YTKHy6Dzb84sH6hyxVEDXz
Match Rust's u8 implementation pattern: - to_ascii_lowercase: c | (is_upper as u32 * CASE_MASK) - to_ascii_uppercase: c ^ (is_lower as u32 * CASE_MASK) where CASE_MASK = 'A' ^ 'a' (0x20). https://claude.ai/code/session_01YTKHy6Dzb84sH6hyxVEDXz
Byte-level comparison using per-byte to_ascii_lowercase, matching Rust's str::eq_ignore_ascii_case which delegates to [u8]'s impl. https://claude.ai/code/session_01YTKHy6Dzb84sH6hyxVEDXz
Working tree is dirtyIntegrity checks produced the following changes: Please run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
char::eq_ignore_ascii_case(&self, other: &char) -> bool— delegates toto_ascii_lowercasecomparison, matching Rust's implementationString::eq_ignore_ascii_case(&self, other: String) -> bool— byte-level comparison using per-byteto_ascii_lowercase, matching Rust'sstr::eq_ignore_ascii_casechar::to_ascii_lowercaseandchar::to_ascii_uppercasebranchless, matching Rust'su8implementation pattern:c | (is_upper as u32 * ('A' ^ 'a'))Test plan
primitive_test.wado: 5 test cases forchar::eq_ignore_ascii_case(same case, different case, non-alpha, different letters, non-alpha with same bit pattern)string_test.wado: 6 test cases forString::eq_ignore_ascii_case(same case, different case, non-alpha, different lengths, empty, non-ASCII)https://claude.ai/code/session_01YTKHy6Dzb84sH6hyxVEDXz