mirror of
https://github.com/ppy/osu
synced 2024-12-28 09:52:56 +00:00
Simplify import ordering logic by making beatmapImportTask non-nullable.
This commit is contained in:
parent
5ca4fd5ab4
commit
6110a847aa
@ -51,7 +51,7 @@ namespace osu.Game.Database
|
||||
var stableStorage = await getStableStorage().ConfigureAwait(false);
|
||||
var importTasks = new List<Task>();
|
||||
|
||||
Task beatmapImportTask = default;
|
||||
Task beatmapImportTask = Task.CompletedTask;
|
||||
if (content.HasFlagFast(StableContent.Beatmaps))
|
||||
importTasks.Add(beatmapImportTask = beatmaps.ImportFromStableAsync(stableStorage));
|
||||
|
||||
@ -59,16 +59,10 @@ namespace osu.Game.Database
|
||||
importTasks.Add(skins.ImportFromStableAsync(stableStorage));
|
||||
|
||||
if (content.HasFlagFast(StableContent.Collections))
|
||||
{
|
||||
importTasks.Add(beatmapImportTask?.ContinueWith(_ => collections.ImportFromStableAsync(stableStorage), TaskContinuationOptions.OnlyOnRanToCompletion)
|
||||
?? collections.ImportFromStableAsync(stableStorage));
|
||||
}
|
||||
importTasks.Add(beatmapImportTask.ContinueWith(_ => collections.ImportFromStableAsync(stableStorage), TaskContinuationOptions.OnlyOnRanToCompletion));
|
||||
|
||||
if (content.HasFlagFast(StableContent.Scores))
|
||||
{
|
||||
importTasks.Add(beatmapImportTask?.ContinueWith(_ => scores.ImportFromStableAsync(stableStorage), TaskContinuationOptions.OnlyOnRanToCompletion)
|
||||
?? scores.ImportFromStableAsync(stableStorage));
|
||||
}
|
||||
importTasks.Add(beatmapImportTask.ContinueWith(_ => scores.ImportFromStableAsync(stableStorage), TaskContinuationOptions.OnlyOnRanToCompletion));
|
||||
|
||||
await Task.WhenAll(importTasks.ToArray()).ConfigureAwait(false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user