Skip to content

Commit 7af7ac2

Browse files
authored
Clean up some comments (#49)
1 parent ff01a02 commit 7af7ac2

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

Sources/Algorithms/Combinations.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ extension Collection {
138138
/// four colors:
139139
///
140140
/// let colors = ["fuchsia", "cyan", "mauve", "magenta"]
141-
/// for combo in colors.combinations(ofCount k: 3) {
141+
/// for combo in colors.combinations(ofCount: 3) {
142142
/// print(combo.joined(separator: ", "))
143143
/// }
144144
/// // fuchsia, cyan, mauve

Sources/Algorithms/Rotate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ extension MutableCollection {
213213
/// rotating.
214214
/// - Returns: The new index of the element that was first pre-rotation.
215215
///
216-
/// - Complexity: O(*n*)
216+
/// - Complexity: O(*n*), where *n* is the length of the collection.
217217
@inlinable
218218
@discardableResult
219219
public mutating func rotate(toStartAt newStart: Index) -> Index {
@@ -273,7 +273,7 @@ extension MutableCollection where Self: BidirectionalCollection {
273273
/// rotating.
274274
/// - Returns: The new index of the element that was first pre-rotation.
275275
///
276-
/// - Complexity: O(*n*)
276+
/// - Complexity: O(*n*), where *n* is the length of the collection.
277277
@inlinable
278278
@discardableResult
279279
public mutating func rotate(toStartAt newStart: Index) -> Index {

Sources/Algorithms/Trim.swift

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,20 @@
1111

1212
extension BidirectionalCollection {
1313

14-
/// Returns a `SubSequence` formed by discarding all elements at the start and end of the collection
15-
/// which satisfy the given predicate.
14+
/// Returns a `SubSequence` formed by discarding all elements at the start and
15+
/// end of the collection which satisfy the given predicate.
1616
///
17-
/// This example uses `trimming(where:)` to get a substring without the white space at the
18-
/// beginning and end of the string:
17+
/// This example uses `trimming(where:)` to get a substring without the white
18+
/// space at the beginning and end of the string:
1919
///
20-
/// ```
21-
/// let myString = " hello, world "
22-
/// print(myString.trimming(where: \.isWhitespace)) // "hello, world"
23-
/// ```
20+
/// let myString = " hello, world "
21+
/// print(myString.trimming(where: \.isWhitespace)) // "hello, world"
2422
///
25-
/// - parameters:
26-
/// - predicate: A closure which determines if the element should be omitted from the
27-
/// resulting slice.
23+
/// - Parameters:
24+
/// - predicate: A closure which determines if the element should be
25+
/// omitted from the resulting slice.
2826
///
29-
/// - complexity: `O(n)`, where `n` is the length of this collection.
27+
/// - Complexity: O(*n*), where *n* is the length of this collection.
3028
///
3129
@inlinable
3230
public func trimming(

0 commit comments

Comments
 (0)