Skip to content

Commit 03b623d

Browse files
committed
correct logic
1 parent f32aca6 commit 03b623d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/AsyncAlgorithms/Retry/Retry.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public func retry<Result, ErrorType, ClockType>(
1414
operation: () async throws(ErrorType) -> sending Result,
1515
strategy: (_ attempt: Int, ErrorType) -> RetryStrategy<ClockType.Instant.Duration> = { _, _ in .backoff(.zero) }
1616
) async throws -> Result where ClockType: Clock, ErrorType: Error {
17-
precondition(maxAttempts >= 0, "Must have at least one attempt")
17+
precondition(maxAttempts > 0, "Must have at least one attempt")
1818
for attempt in 0..<maxAttempts - 1 {
1919
do {
2020
return try await operation()

0 commit comments

Comments
 (0)