Skip to content

Commit 92bca60

Browse files
committed
[stdlib] Additional stdlib comment revisions
1 parent 9a7ecab commit 92bca60

File tree

3 files changed

+35
-39
lines changed

3 files changed

+35
-39
lines changed

stdlib/public/core/HashedCollections.swift.gyb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -996,8 +996,8 @@ public struct Set<Element : Hashable> :
996996
///
997997
/// In the following example, the `bothNeighborsAndEmployees` set is made up
998998
/// of the elements that are in *both* the `employees` and `neighbors` sets.
999-
/// Elements that are in only one or the other are left out of the result of
1000-
/// the intersection.
999+
/// Elements that are in either one or the other, but not both, are left out
1000+
/// of the result of the intersection.
10011001
///
10021002
/// let employees: Set = ["Alicia", "Bethany", "Chris", "Diana", "Eric"]
10031003
/// let neighbors = ["Bethany", "Eric", "Forlani", "Greta"]
@@ -5227,8 +5227,8 @@ extension Set {
52275227
///
52285228
/// In the following example, the `bothNeighborsAndEmployees` set is made up
52295229
/// of the elements that are in *both* the `employees` and `neighbors` sets.
5230-
/// Elements that are in only one or the other are left out of the result of
5231-
/// the intersection.
5230+
/// Elements that are in either one or the other, but not both, are left out
5231+
/// of the result of the intersection.
52325232
///
52335233
/// let employees: Set = ["Alicia", "Bethany", "Chris", "Diana", "Eric"]
52345234
/// let neighbors: Set = ["Bethany", "Eric", "Forlani", "Greta"]

stdlib/public/core/RangeReplaceableCollection.swift.gyb

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public protocol RangeReplaceableIndexable : Indexable {
100100
/// Inserts a new element into the collection at the specified position.
101101
///
102102
/// The new element is inserted before the element currently at the specified
103-
/// index. If you pass the collection's `endIndex` property as the `index`
103+
/// index. If you pass the collection's `endIndex` property as the `i`
104104
/// parameter, the new element is appended to the collection.
105105
///
106106
/// var numbers = [1, 2, 3, 4, 5]
@@ -115,7 +115,7 @@ public protocol RangeReplaceableIndexable : Indexable {
115115
///
116116
/// - Parameters:
117117
/// - newElement: The new element to insert into the collection.
118-
/// - i: The position at which to insert the new element. `index` must be a
118+
/// - i: The position at which to insert the new element. `i` must be a
119119
/// valid index into the collection.
120120
///
121121
/// - Complexity: O(*n*), where *n* is the length of the collection.
@@ -126,7 +126,7 @@ public protocol RangeReplaceableIndexable : Indexable {
126126
///
127127
/// The new elements are inserted before the element currently at the
128128
/// specified index. If you pass the collection's `endIndex` property as the
129-
/// `index` parameter, the new elements are appended to the collection.
129+
/// `i` parameter, the new elements are appended to the collection.
130130
///
131131
/// Here's an example of inserting a range of integers into an array of the
132132
/// same type:
@@ -141,8 +141,8 @@ public protocol RangeReplaceableIndexable : Indexable {
141141
///
142142
/// - Parameters:
143143
/// - newElements: The new elements to insert into the collection.
144-
/// - i: The position at which to insert the new elements. `index` must be
145-
/// a valid index of the collection.
144+
/// - i: The position at which to insert the new elements. `i` must be a
145+
/// valid index of the collection.
146146
///
147147
/// - Complexity: O(*m*), where *m* is the combined length of the collection
148148
/// and `newElements`. If `i` is equal to the collection's `endIndex`
@@ -166,9 +166,9 @@ public protocol RangeReplaceableIndexable : Indexable {
166166
/// Calling this method may invalidate any existing indices for use with this
167167
/// collection.
168168
///
169-
/// - Parameter i: The position of the element to remove. `index` must be
170-
/// a valid index of the collection that is not equal to the collection's
171-
/// end index.
169+
/// - Parameter i: The position of the element to remove. `i` must be a valid
170+
/// index of the collection that is not equal to the collection's end
171+
/// index.
172172
/// - Returns: The removed element.
173173
///
174174
/// - Complexity: O(*n*), where *n* is the length of the collection.
@@ -374,8 +374,7 @@ public protocol RangeReplaceableCollection
374374
where S.Iterator.Element == Iterator.Element
375375
*/
376376

377-
/// Adds the elements of a sequence or collection to the end of this
378-
/// collection.
377+
/// Adds the elements of a sequence to the end of this collection.
379378
///
380379
/// The collection being appended to allocates any additional necessary
381380
/// storage to hold the new elements.
@@ -397,10 +396,9 @@ public protocol RangeReplaceableCollection
397396

398397
/// Inserts a new element into the collection at the specified position.
399398
///
400-
/// The new element is inserted before the element currently at the
401-
/// specified index. If you pass the collection's `endIndex` property as
402-
/// the `index` parameter, the new element is appended to the
403-
/// collection.
399+
/// The new element is inserted before the element currently at the specified
400+
/// index. If you pass the collection's `endIndex` property as the `i`
401+
/// parameter, the new element is appended to the collection.
404402
///
405403
/// var numbers = [1, 2, 3, 4, 5]
406404
/// numbers.insert(100, at: 3)
@@ -413,8 +411,8 @@ public protocol RangeReplaceableCollection
413411
/// collection.
414412
///
415413
/// - Parameter newElement: The new element to insert into the collection.
416-
/// - Parameter i: The position at which to insert the new element.
417-
/// `index` must be a valid index into the collection.
414+
/// - Parameter i: The position at which to insert the new element. `i` must
415+
/// be a valid index into the collection.
418416
///
419417
/// - Complexity: O(*n*), where *n* is the length of the collection.
420418
mutating func insert(_ newElement: Iterator.Element, at i: Index)
@@ -424,7 +422,7 @@ public protocol RangeReplaceableCollection
424422
///
425423
/// The new elements are inserted before the element currently at the
426424
/// specified index. If you pass the collection's `endIndex` property as the
427-
/// `index` parameter, the new elements are appended to the collection.
425+
/// `i` parameter, the new elements are appended to the collection.
428426
///
429427
/// Here's an example of inserting a range of integers into an array of the
430428
/// same type:
@@ -438,8 +436,8 @@ public protocol RangeReplaceableCollection
438436
/// collection.
439437
///
440438
/// - Parameter newElements: The new elements to insert into the collection.
441-
/// - Parameter i: The position at which to insert the new elements. `index`
442-
/// must be a valid index of the collection.
439+
/// - Parameter i: The position at which to insert the new elements. `i` must
440+
/// be a valid index of the collection.
443441
///
444442
/// - Complexity: O(*m*), where *m* is the combined length of the collection
445443
/// and `newElements`. If `i` is equal to the collection's `endIndex`
@@ -462,9 +460,9 @@ public protocol RangeReplaceableCollection
462460
/// Calling this method may invalidate any existing indices for use with this
463461
/// collection.
464462
///
465-
/// - Parameter i: The position of the element to remove. `index` must be
466-
/// a valid index of the collection that is not equal to the collection's
467-
/// end index.
463+
/// - Parameter i: The position of the element to remove. `i` must be a valid
464+
/// index of the collection that is not equal to the collection's end
465+
/// index.
468466
/// - Returns: The removed element.
469467
///
470468
/// - Complexity: O(*n*), where *n* is the length of the collection.
@@ -591,8 +589,7 @@ extension RangeReplaceableCollection {
591589
insert(newElement, at: endIndex)
592590
}
593591

594-
/// Adds the elements of a sequence or collection to the end of this
595-
/// collection.
592+
/// Adds the elements of a sequence to the end of this collection.
596593
///
597594
/// The collection being appended to allocates any additional necessary
598595
/// storage to hold the new elements.
@@ -622,10 +619,9 @@ extension RangeReplaceableCollection {
622619

623620
/// Inserts a new element into the collection at the specified position.
624621
///
625-
/// The new element is inserted before the element currently at the
626-
/// specified index. If you pass the collection's `endIndex` property as
627-
/// the `index` parameter, the new element is appended to the
628-
/// collection.
622+
/// The new element is inserted before the element currently at the specified
623+
/// index. If you pass the collection's `endIndex` property as the `i`
624+
/// parameter, the new element is appended to the collection.
629625
///
630626
/// var numbers = [1, 2, 3, 4, 5]
631627
/// numbers.insert(100, at: 3)
@@ -638,8 +634,8 @@ extension RangeReplaceableCollection {
638634
/// collection.
639635
///
640636
/// - Parameter newElement: The new element to insert into the collection.
641-
/// - Parameter i: The position at which to insert the new element.
642-
/// `index` must be a valid index into the collection.
637+
/// - Parameter i: The position at which to insert the new element. `i` must
638+
/// be a valid index into the collection.
643639
///
644640
/// - Complexity: O(*n*), where *n* is the length of the collection.
645641
public mutating func insert(
@@ -653,7 +649,7 @@ extension RangeReplaceableCollection {
653649
///
654650
/// The new elements are inserted before the element currently at the
655651
/// specified index. If you pass the collection's `endIndex` property as the
656-
/// `index` parameter, the new elements are appended to the collection.
652+
/// `i` parameter, the new elements are appended to the collection.
657653
///
658654
/// Here's an example of inserting a range of integers into an array of the
659655
/// same type:
@@ -667,8 +663,8 @@ extension RangeReplaceableCollection {
667663
/// collection.
668664
///
669665
/// - Parameter newElements: The new elements to insert into the collection.
670-
/// - Parameter i: The position at which to insert the new elements. `index`
671-
/// must be a valid index of the collection.
666+
/// - Parameter i: The position at which to insert the new elements. `i` must
667+
/// be a valid index of the collection.
672668
///
673669
/// - Complexity: O(*m*), where *m* is the combined length of the collection
674670
/// and `newElements`. If `i` is equal to the collection's `endIndex`

stdlib/public/core/SetAlgebra.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ public protocol SetAlgebra : Equatable, ExpressibleByArrayLiteral {
124124
///
125125
/// In the following example, the `bothNeighborsAndEmployees` set is made up
126126
/// of the elements that are in *both* the `employees` and `neighbors` sets.
127-
/// Elements that are in only one or the other are left out of the result of
128-
/// the intersection.
127+
/// Elements that are in either one or the other, but not both, are left out
128+
/// of the result of the intersection.
129129
///
130130
/// let employees: Set = ["Alicia", "Bethany", "Chris", "Diana", "Eric"]
131131
/// let neighbors: Set = ["Bethany", "Eric", "Forlani", "Greta"]

0 commit comments

Comments
 (0)