-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[String] Bug fix for opaque slicing in comparison #14709
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
Conversation
@lancep can you take this over and add test case that fails without this? This fixes the issue where we ignore the trailing end of the slice for pathological or complex comparisons. |
(this reorganization specifically is to unblock some of my small string work, but might as well fix bugs too!) |
Just to see if it's still good: @swift-ci please test |
(Not expecting much here) @swift-ci please smoke benchmark |
Build failed |
Linux failure might be the expected failure until after swiftlang/swift-corelibs-foundation#1441 (comment) is merged
|
func _compareUnicode( | ||
_ lhs: _StringGuts._RawBitPattern, _ rhs: _StringGuts._RawBitPattern | ||
) -> Int { | ||
let left = _StringGuts(rawBits: lhs) | ||
let right = _StringGuts(rawBits: rhs) | ||
return left._compare(right) | ||
|
||
if _slowPath(!left._isContiguous || !right._isContiguous) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Derp, this might be over-indented by one space
Build comment file:Optimized (O)Regression (5)
Improvement (9)
No Changes (364)
Unoptimized (Onone)Regression (9)
Improvement (9)
No Changes (360)
Hardware Overview
|
@swift-ci please test |
@swift-ci please test |
@swift-ci please smoke benchmark |
Build failed |
* Ditched the simple/complex test distinction as they all pass now * fixed indentation
@swift-ci please test |
Build failed |
Build failed |
Build comment file:Optimized (O)Regression (4)
Improvement (10)
No Changes (364)
Unoptimized (Onone)Regression (7)
Improvement (12)
No Changes (359)
Hardware Overview
|
Starting a PR with a minor re-organization attempting to reduce bugs and make
_asOpaque
only appear in non-inlineable code.