Skip to content

Commit e506c13

Browse files
committed
Use guard instead of if for early return
1 parent cd306bd commit e506c13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Algorithms/Rotate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ extension MutableCollection where Self: BidirectionalCollection {
5858
/// - Complexity: O(*n*), where *n* is the length of `subrange`.
5959
@inlinable
6060
public mutating func reverse(subrange: Range<Index>) {
61-
if subrange.isEmpty { return }
61+
guard !subrange.isEmpty else { return }
6262
var lower = subrange.lowerBound
6363
var upper = subrange.upperBound
6464
while lower < upper {

0 commit comments

Comments
 (0)