From bdf36ad23d67184ef61b18257472473e211a4cd3 Mon Sep 17 00:00:00 2001 From: Matt Zanchelli Date: Tue, 9 Feb 2021 16:43:04 -0800 Subject: [PATCH] Avoid ambiguous single-letter variable names --- Sources/Algorithms/Rotate.swift | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Sources/Algorithms/Rotate.swift b/Sources/Algorithms/Rotate.swift index 5b1fcfe..19196cb 100644 --- a/Sources/Algorithms/Rotate.swift +++ b/Sources/Algorithms/Rotate.swift @@ -25,23 +25,23 @@ extension MutableCollection where Self: BidirectionalCollection { /// Output: /// [p o n m e f g h i j k l d c b a] /// ^ ^ - /// f l + /// lower upper /// - /// - Postcondition: For returned indices `(f, l)`: - /// `f == limit || l == limit` + /// - Postcondition: For returned indices `(lower, upper)`: + /// `lower == limit || upper == limit` @usableFromInline @discardableResult internal mutating func _reverse( subrange: Range, until limit: Index ) -> (Index, Index) { - var f = subrange.lowerBound - var l = subrange.upperBound - while f != limit && l != limit { - formIndex(before: &l) - swapAt(f, l) - formIndex(after: &f) + var lower = subrange.lowerBound + var upper = subrange.upperBound + while lower != limit && upper != limit { + formIndex(before: &upper) + swapAt(lower, upper) + formIndex(after: &lower) } - return (f, l) + return (lower, upper) } /// Reverses the elements within the given subrange.