consistant negative stride

This commit is contained in:
Oliver Atkinson committed 2020-11-06 15:52:42 +00:00
1 parent 3669ff0c11
commit dfcc611e1d
1 file changed
+1 -1
+1 -1
View File
@@ -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,