Skip to content

Commit

Permalink
Elide async/await
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Sep 29, 2024
1 parent e669af9 commit f8e02ea
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions JL.Core/Dicts/DictUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ await Task.Run(() =>
Utils.ClearStringPoolIfDictsAreReady();
}

internal static async Task AutoUpdateBuiltInDicts()
internal static Task AutoUpdateBuiltInDicts()
{
DictType[] dicts =
[
Expand Down Expand Up @@ -287,19 +287,14 @@ internal static async Task AutoUpdateBuiltInDicts()
}

Utils.Frontend.Alert(AlertLevel.Information, $"Updating {dict.Type}...");
if (dict.Type is DictType.JMdict)
{
await UpdateJmdict(pathExists, true).ConfigureAwait(false);
}
else if (dict.Type is DictType.JMnedict)
{
await UpdateJmnedict(pathExists, true).ConfigureAwait(false);
}
else
{
await UpdateKanjidic(pathExists, true).ConfigureAwait(false);
}
return dict.Type is DictType.JMdict
? UpdateJmdict(pathExists, true)
: dict.Type is DictType.JMnedict
? UpdateJmnedict(pathExists, true)
: UpdateKanjidic(pathExists, true);
}

return Task.CompletedTask;
}

}

0 comments on commit f8e02ea

Please sign in to comment.