Skip to content

Commit 377bb72

Browse files
committed
small documentation tweek collection -> sequence
1 parent 28bbed8 commit 377bb72

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Guides/Stride.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
[[Source](https://github.com/apple/swift-algorithms/blob/main/Sources/Algorithms/Stride.swift) |
44
[Tests](https://github.com/apple/swift-algorithms/blob/main/Tests/SwiftAlgorithmsTests/StrideTests.swift)]
55

6-
A type that steps over a collection’s elements by the specified amount.
6+
A type that steps over sequence elements by the specified amount.
77

88
This is available through the `striding(by:)` method on any `Sequence`.
99

1010
```swift
1111
(0...10).striding(by: 2) // == [0, 2, 4, 6, 8, 10]
1212
```
1313

14-
If the stride is larger than the collection count, the resulting wrapper only contains the
14+
If the stride is larger than the count, the resulting wrapper only contains the
1515
first element.
1616

1717
The stride amount must be a positive value.

Sources/Algorithms/Stride.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//===----------------------------------------------------------------------===//
1515

1616
extension Sequence {
17-
/// Returns a collection stepping through the elements every `step` starting
17+
/// Returns a sequence stepping through the elements every `step` starting
1818
/// at the first value. Any remainders of the stride will be trimmed.
1919
///
2020
/// (0...10).striding(by: 2) // == [0, 2, 4, 6, 8, 10]
@@ -25,8 +25,8 @@ extension Sequence {
2525
/// O(_k_), where _k_ is the striding `step`.
2626
///
2727
/// - Parameter step: The amount to step with each iteration.
28-
/// - Returns: Returns a collection stepping through the elements by the
29-
/// specified amount.
28+
/// - Returns: Returns a sequence or collection for stepping through the
29+
/// elements by the specified amount.
3030
public func striding(by step: Int) -> Stride<Self> {
3131
Stride(base: self, stride: step)
3232
}

0 commit comments

Comments
 (0)