Skip to content

Conversation

@Azoy
Copy link
Contributor

@Azoy Azoy commented Apr 10, 2022

This add the _caseFolded property to Unicode.Scalar.Properties and hides it behind Unicode SPI.

From the string processing PR:

Michael asks:

Out of curiosity, do we want this as a buffer of scalars or just UTF-8? Also, is there a fast-path check to return self, or is this function call effectively the fast path? If so, then I think it's even more viable to return UTF-8 rather than decoding and re-encoding the scalars.

Note this is a property of Unicode.Scalar.Properties, so we don't have a string self to begin with. The data structure stores distances from the base scalar to each of its mapped scalars. We could store UTF-8 here to avoid the scalar decoding, but using UTF-8 in this current data structure would actually be larger than storing distances (17 bit distances).

@Azoy
Copy link
Contributor Author

Azoy commented Apr 10, 2022

@swift-ci please smoke test

@Azoy Azoy merged commit b4adad5 into swiftlang:main Apr 13, 2022
@Azoy Azoy deleted the add-case-folding branch April 13, 2022 04:08
Azoy added a commit to Azoy/swift that referenced this pull request Jun 1, 2022
[stdlib] Add caseFolded to scalar properties
Azoy added a commit that referenced this pull request Jun 2, 2022
[stdlib] Add caseFolded to scalar properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant