Skip to content

Ensure empty AttributedSubstrings produce no runs #996

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
Nov 1, 2024

Conversation

jmschonfeld
Copy link
Contributor

Empty AttributedSubstrings should contain no runs, however there was a small index calculation bug in which empty substrings in the middle of the string (neither at the start or end indices) would incorrectly expand their ranges to the next run. This resolves the bug by ensuring that the Runs.startIndex == Runs.endIndex for all empty substrings regardless of their location in the string.

Resolves rdar://138432081

@jmschonfeld jmschonfeld requested a review from lorentey October 23, 2024 00:01
@jmschonfeld
Copy link
Contributor Author

@swift-ci please test

@jmschonfeld jmschonfeld merged commit b49bbc6 into swiftlang:main Nov 1, 2024
3 checks passed
@jmschonfeld jmschonfeld deleted the empty-attrsubstring-runs branch November 1, 2024 17:22
cthielen pushed a commit to cthielen/swift-foundation that referenced this pull request Nov 8, 2024
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