Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Mar 2, 2024
1 parent 6325c45 commit 0089a87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ArchiSteamFarm/Helpers/ArchiCacheable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public ArchiCacheable(Func<CancellationToken, Task<(bool Success, T? Result)>> r
} catch (OperationCanceledException e) {
ASF.ArchiLogger.LogGenericDebuggingException(e);

return ReturnFailedValueFor(cacheFallback);
return GetFailedValueFor(cacheFallback);
}

try {
Expand All @@ -75,7 +75,7 @@ public ArchiCacheable(Func<CancellationToken, Task<(bool Success, T? Result)>> r
(bool success, T? result) = await ResolveFunction(cancellationToken).ConfigureAwait(false);

if (!success) {
return ReturnFailedValueFor(cacheFallback, result);
return GetFailedValueFor(cacheFallback, result);
}

InitializedValue = result;
Expand All @@ -85,7 +85,7 @@ public ArchiCacheable(Func<CancellationToken, Task<(bool Success, T? Result)>> r
} catch (OperationCanceledException e) {
ASF.ArchiLogger.LogGenericDebuggingException(e);

return ReturnFailedValueFor(cacheFallback);
return GetFailedValueFor(cacheFallback);
} finally {
InitSemaphore.Release();
}
Expand All @@ -110,7 +110,7 @@ public async Task Reset(CancellationToken cancellationToken = default) {
}
}

private (bool Success, T? Result) ReturnFailedValueFor(ECacheFallback cacheFallback, T? result = default) {
private (bool Success, T? Result) GetFailedValueFor(ECacheFallback cacheFallback, T? result = default) {
if (!Enum.IsDefined(cacheFallback)) {
throw new InvalidEnumArgumentException(nameof(cacheFallback), (int) cacheFallback, typeof(ECacheFallback));
}
Expand Down

0 comments on commit 0089a87

Please sign in to comment.