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 bdf36ad commit 44d359bCopy full SHA for 44d359b
Sources/Algorithms/Rotate.swift
@@ -59,13 +59,12 @@ extension MutableCollection where Self: BidirectionalCollection {
59
@inlinable
60
public mutating func reverse(subrange: Range<Index>) {
61
if subrange.isEmpty { return }
62
- var lo = subrange.lowerBound
63
- var hi = subrange.upperBound
64
-
65
- while lo < hi {
66
- formIndex(before: &hi)
67
- swapAt(lo, hi)
68
- formIndex(after: &lo)
+ var lower = subrange.lowerBound
+ var upper = subrange.upperBound
+ while lower < upper {
+ formIndex(before: &upper)
+ swapAt(lower, upper)
+ formIndex(after: &lower)
69
}
70
71
0 commit comments