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] Improve default implementation of Collection.distance(from:to:) #13292
Conversation
@swift-ci Please test |
1 similar comment
@swift-ci Please test |
Build failed |
Build failed |
Build comment file:Build failed before running benchmark. |
bf89f59
to
f12eb76
Compare
@swift-ci Please test |
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.
LGTM!
Build failed |
f12eb76
to
0b2773f
Compare
@swift-ci Please clean test |
var _start: Index | ||
let _end: Index | ||
let step: IndexDistance | ||
if start > end { |
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.
You can use >
on indexes?
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.
Yep! Comparable
is their one requirement.
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.
Huh, somehow I had it in my mind that they were just Equatable. Well this is nice, then.
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.
You're not wrong! That was the case before the big collections-move-indices change: http://swiftdoc.org/v2.2/protocol/ForwardIndexType/
Reverted in #13328 |
No description provided.