From f346a1fc4f99441083a5d498b30f0e30609772a6 Mon Sep 17 00:00:00 2001 From: Harvmaster Date: Mon, 13 Jul 2026 02:21:37 +0000 Subject: [PATCH] Actually simplify the while look condition --- source/exponential-backoff.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exponential-backoff.ts b/source/exponential-backoff.ts index b19bdeb..f2cd4b0 100644 --- a/source/exponential-backoff.ts +++ b/source/exponential-backoff.ts @@ -88,7 +88,7 @@ export class ExponentialBackoff { // If the max attempts is 0, we should continue indefinitely. const unlimitedAttempts = this.options.maxAttempts === 0; - while (attempt < this.options.maxAttempts || unlimitedAttempts) { + while (unlimitedAttempts || attempt < this.options.maxAttempts) { try { // Await the promise before returning so its execution context remains in the try-catch // If we didn't await, this `run` function would successfully return and any errors would not be caught here.