File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -175,15 +175,12 @@ public protocol Indexable : IndexableBase {
175
175
@warn_unused_result
176
176
func index( _ i: Index , offsetBy n: IndexDistance ) -> Index
177
177
178
- /// Returns the result of advancing `i` by `n` positions, or `nil` if it
179
- /// reaches the `limit`.
178
+ /// Returns the result of advancing `i` by `n` positions, or `nil`
179
+ /// if doing so would pass `limit`.
180
180
///
181
181
/// - Returns:
182
- /// - If `n > 0`, the `n`th successor of `i` or `nil` if the `limit` has
183
- /// been reached.
184
- /// - If `n < 0`, the `n`th predecessor of `i` or `nil` if the `limit` has
185
- /// been reached.
186
- /// - Otherwise, `i` unmodified.
182
+ /// - `nil` if `(limit > i) == (n > 0) && abs(distance(i, limit)) < abs(n)`
183
+ /// - Otherwise, `index(i, offsetBy: n)`
187
184
///
188
185
/// - Precondition: `n >= 0` unless `Self` conforms to
189
186
/// `BidirectionalCollection`.
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ public struct CountableRange<
68
68
///
69
69
/// `upperBound` is not a valid argument to `subscript`, and is always
70
70
/// reachable from `lowerBound` by zero or more applications of
71
- /// `location (after:)`.
71
+ /// `index (after:)`.
72
72
///
73
73
/// Identical to `lowerBound` in an empty range.
74
74
public let upperBound: Bound
You can’t perform that action at this time.
0 commit comments