@@ -90,15 +90,14 @@ public protocol _IndexableBase {
90
90
subscript( position: Index ) -> _Element { get }
91
91
92
92
// WORKAROUND: rdar://25214066
93
- /// A sequence that can represent a contiguous subrange of the collection's
93
+ /// A sequence that represents a contiguous subrange of the collection's
94
94
/// elements.
95
95
associatedtype SubSequence
96
96
97
97
/// Accesses the subsequence bounded by the given range.
98
98
///
99
99
/// - Parameter bounds: A range of the collection's indices. The upper and
100
- /// lower bounds of the `bounds` range must be valid indices of the
101
- /// collection.
100
+ /// lower bounds of the range must be valid indices of the collection.
102
101
///
103
102
/// - Complexity: O(1)
104
103
subscript( bounds: Range < Index > ) -> SubSequence { get }
@@ -148,7 +147,7 @@ public protocol _IndexableBase {
148
147
149
148
/// Returns the position immediately after the given index.
150
149
///
151
- /// The successor of an index must be well- defined. For an index `i` into a
150
+ /// The successor of an index must be well defined. For an index `i` into a
152
151
/// collection `c`, calling `c.index(after: i)` returns the same index every
153
152
/// time.
154
153
///
@@ -174,7 +173,7 @@ public protocol _IndexableBase {
174
173
@available ( * , deprecated, message: " it will be removed in Swift 4.0. Please use 'Collection' instead " )
175
174
public typealias Indexable = _Indexable
176
175
public protocol _Indexable : _IndexableBase {
177
- /// A type used to represent the number of steps between two indices, where
176
+ /// A type that represents the number of steps between two indices, where
178
177
/// one value is reachable from the other.
179
178
///
180
179
/// In Swift, *reachability* refers to the ability to produce one value from
@@ -191,8 +190,8 @@ public protocol _Indexable : _IndexableBase {
191
190
/// print(s[i])
192
191
/// // Prints "t"
193
192
///
194
- /// The value passed as `n` must not offset `i` beyond the `endIndex` or
195
- /// before the `startIndex` of this collection.
193
+ /// The value passed as `n` must not offset `i` beyond the bounds of the
194
+ /// collection.
196
195
///
197
196
/// - Parameters:
198
197
/// - i: A valid index of the collection.
@@ -231,9 +230,9 @@ public protocol _Indexable : _IndexableBase {
231
230
/// print(j)
232
231
/// // Prints "nil"
233
232
///
234
- /// The value passed as `n` must not offset `i` beyond the `endIndex` or
235
- /// before the `startIndex` of this collection, unless the index passed as
236
- /// `limit` prevents offsetting beyond those bounds.
233
+ /// The value passed as `n` must not offset `i` beyond the bounds of the
234
+ /// collection, unless the index passed as `limit` prevents offsetting
235
+ /// beyond those bounds.
237
236
///
238
237
/// - Parameters:
239
238
/// - i: A valid index of the collection.
@@ -256,8 +255,8 @@ public protocol _Indexable : _IndexableBase {
256
255
257
256
/// Offsets the given index by the specified distance.
258
257
///
259
- /// The value passed as `n` must not offset `i` beyond the `endIndex` or
260
- /// before the `startIndex` of this collection.
258
+ /// The value passed as `n` must not offset `i` beyond the bounds of the
259
+ /// collection.
261
260
///
262
261
/// - Parameters:
263
262
/// - i: A valid index of the collection.
@@ -273,9 +272,9 @@ public protocol _Indexable : _IndexableBase {
273
272
/// Offsets the given index by the specified distance, or so that it equals
274
273
/// the given limiting index.
275
274
///
276
- /// The value passed as `n` must not offset `i` beyond the `endIndex` or
277
- /// before the `startIndex` of this collection, unless the index passed as
278
- /// `limit` prevents offsetting beyond those bounds.
275
+ /// The value passed as `n` must not offset `i` beyond the bounds of the
276
+ /// collection, unless the index passed as `limit` prevents offsetting
277
+ /// beyond those bounds.
279
278
///
280
279
/// - Parameters:
281
280
/// - i: A valid index of the collection.
@@ -546,15 +545,15 @@ public struct IndexingIterator<
546
545
/// count the number of contained elements, accessing its `count` property is
547
546
/// an O(*n*) operation.
548
547
public protocol Collection : _Indexable , Sequence {
549
- /// A type that can represent the number of steps between a pair of
548
+ /// A type that represents the number of steps between a pair of
550
549
/// indices.
551
550
associatedtype IndexDistance : SignedInteger = Int
552
551
553
552
/// A type that provides the collection's iteration interface and
554
553
/// encapsulates its iteration state.
555
554
///
556
555
/// By default, a collection conforms to the `Sequence` protocol by
557
- /// supplying a `IndexingIterator` as its associated `Iterator`
556
+ /// supplying `IndexingIterator` as its associated `Iterator`
558
557
/// type.
559
558
associatedtype Iterator : IteratorProtocol = IndexingIterator < Self >
560
559
@@ -632,7 +631,7 @@ public protocol Collection : _Indexable, Sequence {
632
631
/// - Complexity: O(1)
633
632
subscript( bounds: Range < Index > ) -> SubSequence { get }
634
633
635
- /// A type that can represent the indices that are valid for subscripting the
634
+ /// A type that represents the indices that are valid for subscripting the
636
635
/// collection, in ascending order.
637
636
associatedtype Indices : _Indexable , Sequence = DefaultIndices < Self >
638
637
@@ -649,10 +648,10 @@ public protocol Collection : _Indexable, Sequence {
649
648
/// order.
650
649
///
651
650
/// A collection's `indices` property can hold a strong reference to the
652
- /// collection itself, causing the collection to be non-uniquely referenced.
651
+ /// collection itself, causing the collection to be nonuniquely referenced.
653
652
/// If you mutate the collection while iterating over its indices, a strong
654
- /// reference can cause an unexpected copy of the collection. To avoid the
655
- /// unexpected copy, use the `index(after:)` method starting with
653
+ /// reference can result in an unexpected copy of the collection. To avoid
654
+ /// the unexpected copy, use the `index(after:)` method starting with
656
655
/// `startIndex` to produce indices instead.
657
656
///
658
657
/// var c = MyFancyCollection([10, 20, 30, 40, 50])
@@ -802,8 +801,8 @@ public protocol Collection : _Indexable, Sequence {
802
801
/// print(s[i])
803
802
/// // Prints "t"
804
803
///
805
- /// The value passed as `n` must not offset `i` beyond the `endIndex` or
806
- /// before the `startIndex` of this collection.
804
+ /// The value passed as `n` must not offset `i` beyond the bounds of the
805
+ /// collection.
807
806
///
808
807
/// - Parameters:
809
808
/// - i: A valid index of the collection.
@@ -842,9 +841,9 @@ public protocol Collection : _Indexable, Sequence {
842
841
/// print(j)
843
842
/// // Prints "nil"
844
843
///
845
- /// The value passed as `n` must not offset `i` beyond the `endIndex` or
846
- /// before the `startIndex` of this collection, unless the index passed as
847
- /// `limit` prevents offsetting beyond those bounds.
844
+ /// The value passed as `n` must not offset `i` beyond the bounds of the
845
+ /// collection, unless the index passed as `limit` prevents offsetting
846
+ /// beyond those bounds.
848
847
///
849
848
/// - Parameters:
850
849
/// - i: A valid index of the collection.
@@ -941,8 +940,8 @@ extension _Indexable {
941
940
/// print(s[i])
942
941
/// // Prints "t"
943
942
///
944
- /// The value passed as `n` must not offset `i` beyond the `endIndex` or
945
- /// before the `startIndex` of this collection.
943
+ /// The value passed as `n` must not offset `i` beyond the bounds of the
944
+ /// collection.
946
945
///
947
946
/// - Parameters:
948
947
/// - i: A valid index of the collection.
@@ -983,9 +982,9 @@ extension _Indexable {
983
982
/// print(j)
984
983
/// // Prints "nil"
985
984
///
986
- /// The value passed as `n` must not offset `i` beyond the `endIndex` or
987
- /// before the `startIndex` of this collection, unless the index passed as
988
- /// `limit` prevents offsetting beyond those bounds.
985
+ /// The value passed as `n` must not offset `i` beyond the bounds of the
986
+ /// collection, unless the index passed as `limit` prevents offsetting
987
+ /// beyond those bounds.
989
988
///
990
989
/// - Parameters:
991
990
/// - i: A valid index of the collection.
@@ -1010,8 +1009,8 @@ extension _Indexable {
1010
1009
1011
1010
/// Offsets the given index by the specified distance.
1012
1011
///
1013
- /// The value passed as `n` must not offset `i` beyond the `endIndex` or
1014
- /// before the `startIndex` of this collection.
1012
+ /// The value passed as `n` must not offset `i` beyond the bounds of the
1013
+ /// collection.
1015
1014
///
1016
1015
/// - Parameters:
1017
1016
/// - i: A valid index of the collection.
@@ -1029,9 +1028,9 @@ extension _Indexable {
1029
1028
/// Offsets the given index by the specified distance, or so that it equals
1030
1029
/// the given limiting index.
1031
1030
///
1032
- /// The value passed as `n` must not offset `i` beyond the `endIndex` or
1033
- /// before the `startIndex` of this collection, unless the index passed as
1034
- /// `limit` prevents offsetting beyond those bounds.
1031
+ /// The value passed as `n` must not offset `i` beyond the bounds of the
1032
+ /// collection, unless the index passed as `limit` prevents offsetting
1033
+ /// beyond those bounds.
1035
1034
///
1036
1035
/// - Parameters:
1037
1036
/// - i: A valid index of the collection.
0 commit comments