Skip to content

Commit 5810032

Browse files
authored
Simplify TestScheduler sorting (#131)
Hat tip to @mattt (https://twitter.com/mattt/status/1264976073965502464)
1 parent a1b1599 commit 5810032

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/ComposableArchitecture/Scheduling/TestScheduler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ where SchedulerTimeType: Strideable, SchedulerTimeType.Stride: SchedulerTimeInte
2121
///
2222
/// - Parameter stride: A stride.
2323
public func advance(by stride: SchedulerTimeType.Stride = .zero) {
24-
self.scheduled.sort { $0.date < $1.date || ($0.date == $1.date && $0.id < $1.id) }
24+
self.scheduled.sort { ($0.date, $0.id) < ($1.date, $1.id) }
2525

2626
guard
2727
let nextDate = self.scheduled.first?.date,

0 commit comments

Comments
 (0)