Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced TimeInterval with DispatchTimeInterval #718

Merged
merged 11 commits into from
May 3, 2020
Prev Previous commit
Next Next commit
Simplify NMBWait.until implementations
  • Loading branch information
ikesyo committed May 3, 2020
commit 5388a2c963a2de346d80deca7062c8771060a159
17 changes: 2 additions & 15 deletions Sources/Nimble/DSL+Wait.swift
Original file line number Diff line number Diff line change
@@ -22,11 +22,9 @@ internal class NMBWait: NSObject {
line: UInt = #line,
action: @escaping (@escaping () -> Void) -> Void) {
// Convert TimeInterval to DispatchTimeInterval
let dispatchTimeout: DispatchTimeInterval = timeout.dispatchInterval
return throwableUntil(timeout: dispatchTimeout, file: file, line: line) { done in
action(done)
}
until(timeout: timeout.dispatchInterval, file: file, line: line, action: action)
}
#endif

internal class func until(
timeout: DispatchTimeInterval,
@@ -37,17 +35,6 @@ internal class NMBWait: NSObject {
action(done)
}
}
#else
internal class func until(
timeout: DispatchTimeInterval,
file: FileString = #file,
line: UInt = #line,
action: @escaping (@escaping () -> Void) -> Void) {
return throwableUntil(timeout: timeout, file: file, line: line) { done in
action(done)
}
}
#endif

// Using a throwable closure makes this method not objc compatible.
internal class func throwableUntil(