Skip to content

Commit bdf36ad

Browse files
committed
Avoid ambiguous single-letter variable names
1 parent 7ca12be commit bdf36ad

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Sources/Algorithms/Rotate.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ extension MutableCollection where Self: BidirectionalCollection {
2525
/// Output:
2626
/// [p o n m e f g h i j k l d c b a]
2727
/// ^ ^
28-
/// f l
28+
/// lower upper
2929
///
30-
/// - Postcondition: For returned indices `(f, l)`:
31-
/// `f == limit || l == limit`
30+
/// - Postcondition: For returned indices `(lower, upper)`:
31+
/// `lower == limit || upper == limit`
3232
@usableFromInline
3333
@discardableResult
3434
internal mutating func _reverse(
3535
subrange: Range<Index>, until limit: Index
3636
) -> (Index, Index) {
37-
var f = subrange.lowerBound
38-
var l = subrange.upperBound
39-
while f != limit && l != limit {
40-
formIndex(before: &l)
41-
swapAt(f, l)
42-
formIndex(after: &f)
37+
var lower = subrange.lowerBound
38+
var upper = subrange.upperBound
39+
while lower != limit && upper != limit {
40+
formIndex(before: &upper)
41+
swapAt(lower, upper)
42+
formIndex(after: &lower)
4343
}
44-
return (f, l)
44+
return (lower, upper)
4545
}
4646

4747
/// Reverses the elements within the given subrange.

0 commit comments

Comments
 (0)