We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3669ff0 commit dfcc611Copy full SHA for dfcc611
Sources/Algorithms/Stride.swift
@@ -155,7 +155,7 @@ extension Stride: Collection where Base: Collection {
155
limitedBy limit: Index
156
) -> Index? {
157
let distance = i == endIndex
158
- ? -((base.count - 1) % stride + 1) + (1 - n) * stride
+ ? -((base.count - 1) % stride + 1) + (n - 1) * -stride
159
: n * -stride
160
return base.index(
161
i.base,
0 commit comments