Skip to content

Commit

Permalink
fix SchedulerTimeType::distance(to:)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Mayoff committed Feb 3, 2021
1 parent cf0d505 commit f97d175
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/CXFoundation/OperationQueue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ extension CXWrappers.OperationQueue: CombineX.Scheduler {
/// - Returns: The time interval between this time and the provided time.
public func distance(to other: SchedulerTimeType) -> SchedulerTimeType.Stride {

return SchedulerTimeType.Stride(floatLiteral: date.timeIntervalSince(other.date))
return SchedulerTimeType.Stride(floatLiteral: other.date.timeIntervalSince(date))
}

/// Returns a operation queue scheduler time calculated by advancing this instance’s time by the given interval.
Expand Down
2 changes: 1 addition & 1 deletion Sources/CXFoundation/RunLoop.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ extension CXWrappers.RunLoop: CombineX.Scheduler {
/// - Parameter other: Another dispatch queue time.
/// - Returns: The time interval between this time and the provided time.
public func distance(to other: SchedulerTimeType) -> SchedulerTimeType.Stride {
return Stride(floatLiteral: date.timeIntervalSince(other.date))
return Stride(floatLiteral: other.date.timeIntervalSince(date))
}

/// Returns a run loop scheduler time calculated by advancing this instance’s time by the given interval.
Expand Down

0 comments on commit f97d175

Please sign in to comment.