Skip to content

Retrieving attributed string attribute values should not use identity casts #1290

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

Merged
merged 1 commit into from
May 14, 2025

Conversation

jmschonfeld
Copy link
Contributor

This reverts a small portion of #1287. It's not always possible to use an identity cast here, because in some cases (such as catalyst applications where AttributedStrings interchangeably use both UIKit UIColor and AppKit NSColor attributes) we do rely on dynamic casting behavior. The dynamic cast should attempt an identity cast first so this shouldn't have a strong impact on the overall performance win since we still avoid the optional boxing in __equalAttributes and retain the performance wins from the runs view.

@jmschonfeld jmschonfeld requested a review from itingliu May 14, 2025 16:27
@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld jmschonfeld requested review from parkera and iCharlesHu May 14, 2025 17:29
@jmschonfeld jmschonfeld merged commit 5164280 into swiftlang:main May 14, 2025
15 checks passed
@jmschonfeld jmschonfeld deleted the attrstr/identity-cast-crash branch May 14, 2025 18:42
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.

2 participants