-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[stdlib] swapAt method #9119
[stdlib] swapAt method #9119
Conversation
@swift-ci please benchmark |
@swift-ci please test |
/// Has no effect when `i` and `j` are equal. | ||
@_inlineable | ||
public mutating func swapAt(_ i: Index, _ j: Index) { | ||
guard i != j else { return } |
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.
This is an interesting nuance. For reference types, this wouldn't be a drop-in replacement for the old swap
, would it?
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.
Well, the old swap
used to (attempt to) trap in this case, so it should be. Unless I'm missing something.
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.
@airspeedswift My bad. You're checking for equality of the indices.
Build failed |
Build failed |
@swift-ci please test |
Build failed |
Build failed |
Build comment file:Optimized (O) Regression (9)
Improvement (5)
No Changes (255)
Regression (4)
Improvement (5)
No Changes (260)
|
6ef1415
to
1ee492e
Compare
@swift-ci please clean test |
@swift-ci please benchmark |
Build failed |
Build failed |
@swift-ci please clean test macOS platform |
Looks like OS X tests passed based on the logs, but the bot hung updating status. |
@swift-ci please smoke benchmark |
Build comment file:Optimized (O) Regression (3)
Improvement (10)
No Changes (256)
Regression (3)
Improvement (2)
No Changes (264)
|
Build comment file:Optimized (O) Regression (4)
Improvement (11)
No Changes (254)
Regression (1)
Improvement (4)
No Changes (264)
|
No description provided.