mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 19:03:08 +08:00
Re-query beatmap difficulty before computing
This commit is contained in:
parent
2a1511f436
commit
43c61e5830
@ -89,8 +89,14 @@ namespace osu.Game.Beatmaps
|
||||
if (tryGetExisting(beatmapInfo, rulesetInfo, mods, out var existing, out var key))
|
||||
return existing;
|
||||
|
||||
return await Task.Factory.StartNew(() => computeDifficulty(key, beatmapInfo, rulesetInfo), cancellationToken,
|
||||
TaskCreationOptions.HideScheduler | TaskCreationOptions.RunContinuationsAsynchronously, updateScheduler);
|
||||
return await Task.Factory.StartNew(() =>
|
||||
{
|
||||
// Computation may have finished in a previous task.
|
||||
if (tryGetExisting(beatmapInfo, rulesetInfo, mods, out existing, out _))
|
||||
return existing;
|
||||
|
||||
return computeDifficulty(key, beatmapInfo, rulesetInfo);
|
||||
}, cancellationToken, TaskCreationOptions.HideScheduler | TaskCreationOptions.RunContinuationsAsynchronously, updateScheduler);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user