Skip to content

Commit 72d8690

Browse files
committed
[stdlib] Fixes to doc. for formIndex of Indexable
Added documentation description for third parameter of formIndex(_:offsetBy:limitedBy:) which was previously omitted. Description copied from the 'index(_:offsetBy:limitedBy:)' method.
1 parent 592a298 commit 72d8690

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

stdlib/public/core/Collection.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,9 @@ public protocol _Indexable : _IndexableBase {
281281
/// - i: A valid index of the collection.
282282
/// - n: The distance to offset `i`. `n` must not be negative unless the
283283
/// collection conforms to the `BidirectionalCollection` protocol.
284+
/// - limit: A valid index of the collection to use as a limit. If `n > 0`,
285+
/// a limit that is less than `i` has no effect. Likewise, if `n < 0`, a
286+
/// limit that is greater than `i` has no effect.
284287
/// - Returns: `true` if `i` has been offset by exactly `n` steps without
285288
/// going beyond `limit`; otherwise, `false`. When the return value is
286289
/// `false`, the value of `i` is equal to `limit`.
@@ -1037,6 +1040,9 @@ extension _Indexable {
10371040
/// - i: A valid index of the collection.
10381041
/// - n: The distance to offset `i`. `n` must not be negative unless the
10391042
/// collection conforms to the `BidirectionalCollection` protocol.
1043+
/// - limit: A valid index of the collection to use as a limit. If `n > 0`,
1044+
/// a limit that is less than `i` has no effect. Likewise, if `n < 0`, a
1045+
/// limit that is greater than `i` has no effect.
10401046
/// - Returns: `true` if `i` has been offset by exactly `n` steps without
10411047
/// going beyond `limit`; otherwise, `false`. When the return value is
10421048
/// `false`, the value of `i` is equal to `limit`.

0 commit comments

Comments
 (0)