Skip to content

Commit 6e5b471

Browse files
authored
"if is RandomAccessCollection" is unnecessary
* remove the performance qualifiers on API redeclared from `Collection`, because they are necessarily satisfied.
1 parent fcf9cfb commit 6e5b471

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

stdlib/public/core/RandomAccessCollection.swift

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,7 @@ where SubSequence: RandomAccessCollection, Indices: RandomAccessCollection
152152
/// is the same value as the result of `abs(distance)` calls to
153153
/// `index(before:)`.
154154
///
155-
/// - Complexity: O(1) if the collection conforms to
156-
/// `RandomAccessCollection`; otherwise, O(*k*), where *k* is the absolute
157-
/// value of `distance`.
155+
/// - Complexity: O(1)
158156
func index(_ i: Index, offsetBy distance: Int) -> Index
159157

160158
/// Returns an index that is the specified distance from the given index,
@@ -196,9 +194,7 @@ where SubSequence: RandomAccessCollection, Indices: RandomAccessCollection
196194
/// index would be beyond `limit` in the direction of movement. In that
197195
/// case, the method returns `nil`.
198196
///
199-
/// - Complexity: O(1) if the collection conforms to
200-
/// `RandomAccessCollection`; otherwise, O(*k*), where *k* is the absolute
201-
/// value of `distance`.
197+
/// - Complexity: O(1)
202198
func index(
203199
_ i: Index, offsetBy distance: Int, limitedBy limit: Index
204200
) -> Index?
@@ -216,9 +212,7 @@ where SubSequence: RandomAccessCollection, Indices: RandomAccessCollection
216212
/// negative only if the collection conforms to the
217213
/// `BidirectionalCollection` protocol.
218214
///
219-
/// - Complexity: O(1) if the collection conforms to
220-
/// `RandomAccessCollection`; otherwise, O(*k*), where *k* is the
221-
/// resulting distance.
215+
/// - Complexity: O(1)
222216
func distance(from start: Index, to end: Index) -> Int
223217
}
224218

0 commit comments

Comments
 (0)