diff --git a/Sources/Algorithms/Stride.swift b/Sources/Algorithms/Stride.swift index 4e35ebd..a922895 100644 --- a/Sources/Algorithms/Stride.swift +++ b/Sources/Algorithms/Stride.swift @@ -155,7 +155,7 @@ extension Stride: Collection where Base: Collection { limitedBy limit: Index ) -> Index? { let distance = i == endIndex - ? -((base.count - 1) % stride + 1) + (1 - n) * stride + ? -((base.count - 1) % stride + 1) + (n - 1) * -stride : n * -stride return base.index( i.base,