Skip to content

Off-by-one error in precondition#5311

Merged
jmschonfeld merged 2 commits intoswiftlang:mainfrom
SiliconA-Z:import
Jan 13, 2026
Merged

Off-by-one error in precondition#5311
jmschonfeld merged 2 commits intoswiftlang:mainfrom
SiliconA-Z:import

Conversation

@SiliconA-Z
Copy link
Contributor

for index <= position, if bytes.count == 0 and index == position, then we don't want this condition to be true at all.

@SiliconA-Z
Copy link
Contributor Author

@parkera Thoughts?

@SiliconA-Z SiliconA-Z force-pushed the import branch 2 times, most recently from b7d2fd4 to f0d282f Compare December 20, 2025 05:29
Copy link
Contributor

@jmschonfeld jmschonfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code change itself looks fine to me, but a few minor comments on the unit test

for index <= position, if bytes.count == 0 and index == position, then we don't want this condition to be true at all.
Co-authored-by: Jeremy Schonfeld <jeremyschonfeld@gmail.com>
@jmschonfeld
Copy link
Contributor

@swift-ci please test

@jmschonfeld
Copy link
Contributor

@swift-ci please test Windows platform

@jmschonfeld jmschonfeld merged commit 39f860e into swiftlang:main Jan 13, 2026
2 checks passed
@SiliconA-Z SiliconA-Z deleted the import branch January 13, 2026 21:22
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