mirror of
https://github.com/apple/swift-algorithms
synced 2026-11-24 04:17:48 +00:00
consistant negative stride
This commit is contained in:
1 file changed
+1
-1
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user