mirror of
https://github.com/apple/swift-algorithms
synced 2026-11-25 04:27:47 +00:00
Use consistent variable names
This commit is contained in:
1 parent
bdf36ad23d
commit
44d359b429
1 file changed
+6
-7
@@ -59,13 +59,12 @@ extension MutableCollection where Self: BidirectionalCollection {
|
||||
@inlinable
|
||||
public mutating func reverse(subrange: Range<Index>) {
|
||||
if subrange.isEmpty { return }
|
||||
var lo = subrange.lowerBound
|
||||
var hi = subrange.upperBound
|
||||
|
||||
while lo < hi {
|
||||
formIndex(before: &hi)
|
||||
swapAt(lo, hi)
|
||||
formIndex(after: &lo)
|
||||
var lower = subrange.lowerBound
|
||||
var upper = subrange.upperBound
|
||||
while lower < upper {
|
||||
formIndex(before: &upper)
|
||||
swapAt(lower, upper)
|
||||
formIndex(after: &lower)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user