From 8294d398ed046a0f0b770b383428d6ad61b2ba98 Mon Sep 17 00:00:00 2001 From: MareStare Date: Tue, 4 Mar 2025 05:08:44 +0200 Subject: [PATCH] Eliminate a redundant variable Co-authored-by: liamwhite --- assets/js/utils/retry.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/assets/js/utils/retry.ts b/assets/js/utils/retry.ts index 8aecb04d..bd99ab72 100644 --- a/assets/js/utils/retry.ts +++ b/assets/js/utils/retry.ts @@ -73,11 +73,10 @@ export async function retry(func: RetryFunc, params?: RetryParams): Promis const hasNextAttempts = attempt < maxAttempts; try { - // XXX: an `await` is important in this block to make sure the exception is caught + // NB: an `await` is important in this block to make sure the exception is caught // in this scope. Doing a `return func()` would be a big mistake, so don't try // to "refactor" that! - const result = await func(attempt, hasNextAttempts ? nextDelayMs : undefined); - return result; + return await func(attempt, hasNextAttempts ? nextDelayMs : undefined); } catch (error) { if (!(error instanceof Error) || (params?.isRetryable && !params.isRetryable(error))) { throw error;