-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
New ASCII APIs #75012
Merged
Merged
New ASCII APIs #75012
Changes from 48 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
af2b950
Initial ASCII methods
GrabYourPitchforks bd2b5f1
Add transcoding APIs
GrabYourPitchforks db37d32
Implement Trim
GrabYourPitchforks 4a832cc
Split ASCII utilities into separate files
GrabYourPitchforks e054a01
Add ref asm
GrabYourPitchforks 36cbfa6
Fun with case conversion!
GrabYourPitchforks bba61f5
Fun with case conversion!
GrabYourPitchforks 89331d6
Updates!
GrabYourPitchforks 8333ec8
Fix incorrect comparison
GrabYourPitchforks 841fe3c
Fix incorrect precondition checks
GrabYourPitchforks dce2cae
Update main vectorized loop
GrabYourPitchforks 685b330
Perf improvements & fix arithmetic error
GrabYourPitchforks 4914c65
tests for Ascii.GetIndexOfFirstNonAsciiByte
adamsitnik 7204d2d
tests for Ascii.GetIndexOfFirstNonAsciiChar
adamsitnik e3709b7
add tests for Ascii.IsAscii
adamsitnik fc6db59
add tests for Ascii.FromUtf16
adamsitnik e316789
add tests for Ascii.ToUtf16
adamsitnik a5f61b9
add tests for Ascii.Trim* and fix bug they have discovered
adamsitnik 6516ae2
ToUpper & ToLower tests
adamsitnik 6e1ca32
implement the missing pieces for case conversions + fix the tests
adamsitnik 5c90223
Merge remote-tracking branch 'upstream/main' into asciiAPIs
adamsitnik 4339af5
implement TryToLowerInPlace/TryToUpperInPlace
adamsitnik cc3be10
implement Ascii.StartsWith* and EndsWith* methods
adamsitnik ad4d90b
implement Ascii.Equals* methods
adamsitnik adc2f53
use self-describing names at a cost of using pragma disable ;)
adamsitnik aad125a
throw ArgumentException with meaningful error message
adamsitnik f8f98ed
rename files
adamsitnik 2b2bcd1
Implement IndexOf and LastIndexOf using narrowing and widening
adamsitnik 2d9105e
Implement IndexOfIgnoreCase and LastIndexOfIgnoreCase
adamsitnik cc603c7
refactoring
adamsitnik aff7e6e
IsAscii methods
adamsitnik bf5d709
*GetHashCode(chars)
adamsitnik ba1102d
*GetHashCode(bytes)
adamsitnik 0ffd3ee
solve buffer overrun: 8 chars need to be narrowed to 8 (not 16 like b…
adamsitnik 6f96b8b
disable the tests that are failing due to Mono bug
adamsitnik 8ab53c2
Merge remote-tracking branch 'upstream/main' into asciiAPIs
adamsitnik 3d5df19
fix a bug (tests that are not compiled are always passing)
adamsitnik 518ef05
use new APIs across BCL:
adamsitnik ab12f70
Apply suggestions from code review
adamsitnik 29b38f6
address code review feedback
adamsitnik bc48a30
Merge remote-tracking branch 'upstream/main' into asciiAPIs
adamsitnik 1edc812
fold ASCIIUtility into Ascii, use public APIs
adamsitnik e2d7105
fix tests that were relying on reflection so far (and I did not know …
adamsitnik 6106659
fix byte->char casting
adamsitnik 0d69abd
adjust code after recent API Review
adamsitnik bb0a272
add missing XML docs
adamsitnik b1f1f07
Merge remote-tracking branch 'upstream/main' into asciiAPIs
adamsitnik c0f38d1
cleanup
adamsitnik da94353
address code review feedback
adamsitnik b975fe1
Merge remote-tracking branch 'upstream/main' into asciiAPIs
adamsitnik 4483baf
Update src/libraries/System.Private.Uri/src/System/DomainNameHelper.cs
adamsitnik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR, but as a potential follow-up, if it'll be common for pNative to be non-NULL and if data suggests it'll be long enough on average, it might be worth trying a fast-path that just does FromUtf16 without first doing IsValid.