From 44d359b4297a4edb948e599f6576668b1063b0ac Mon Sep 17 00:00:00 2001 From: Matt Zanchelli Date: Tue, 9 Feb 2021 16:43:15 -0800 Subject: [PATCH] Use consistent variable names --- Sources/Algorithms/Rotate.swift | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Sources/Algorithms/Rotate.swift b/Sources/Algorithms/Rotate.swift index 19196cb..08799ed 100644 --- a/Sources/Algorithms/Rotate.swift +++ b/Sources/Algorithms/Rotate.swift @@ -59,13 +59,12 @@ extension MutableCollection where Self: BidirectionalCollection { @inlinable public mutating func reverse(subrange: Range) { 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) } } }