Add CharacterSet Benchmarks & Updates to BuiltInUnicodeScalarSet#1751
Open
chloe-yeo wants to merge 3 commits intoswiftlang:mainfrom
Open
Add CharacterSet Benchmarks & Updates to BuiltInUnicodeScalarSet#1751chloe-yeo wants to merge 3 commits intoswiftlang:mainfrom
chloe-yeo wants to merge 3 commits intoswiftlang:mainfrom
Conversation
…(#3586) Co-authored-by: T Liu <iting_liu@apple.com>
Contributor
Author
|
@swift-ci please test |
jmschonfeld
approved these changes
Feb 16, 2026
Contributor
jmschonfeld
left a comment
There was a problem hiding this comment.
LGTM (knowing that unit tests coming as an eventual followup will cover the new UnicodeScalar Set code and that existing unit tests cover the existing behavior)
itingliu
approved these changes
Feb 16, 2026
Comment on lines
+178
to
+182
| if plane < 3 || plane > 13 { | ||
| return true | ||
| } else { | ||
| return false | ||
| } |
Contributor
There was a problem hiding this comment.
This is correct but I believe we also have a followup to improve this to
Suggested change
| if plane < 3 || plane > 13 { | |
| return true | |
| } else { | |
| return false | |
| } | |
| return plane < 3 || plane > 13 |
right?
I think this is less error prone given we've seen bugs caused by copy-paste errors when we manually unroll the boolean checks like this...
Contributor
Author
There was a problem hiding this comment.
Yep added as follow-up!
| case .bitmapEmpty: | ||
| // For empty result, return the appropriate fill pattern | ||
| if isInverted { | ||
| return Data(repeating: 0x00, count: 65536 / 8) |
Contributor
There was a problem hiding this comment.
I also believe we have a followup task to return a static Data for these ones right?
Contributor
Author
There was a problem hiding this comment.
Added as follow-up!
Contributor
Author
|
@swift-ci please test |
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.
This PR adds benchmarks for
CharacterSetand adds cases toBuiltInUnicodeScalarSetto account for types that were previously not accounted for.Motivation:
This is to lay the groundwork for adding a Swift-native
CharacterSetimplementation in this repository.Modifications:
Added benchmarks for
CharacterSetand modified theBuiltInUnicodeScalarSetto account for additional built-in sets.Result:
No behavior changes.
Testing:
Building and unit testing to confirm functions are unused/behavior is the same.