1
0
mirror of https://github.com/ppy/osu.git synced 2024-05-15 03:20:20 +08:00

Return Task.CompletedTask instead of null

This commit is contained in:
Joseph Madamba 2024-04-22 11:22:39 -07:00
parent a59bf6d373
commit 35eddf35c5

View File

@ -201,16 +201,16 @@ namespace osu.Game.Scoring
/// Export a replay from a given <see cref="IScoreInfo"/>.
/// </summary>
/// <param name="scoreInfo">The <see cref="IScoreInfo"/> to export.</param>
/// <returns>The <see cref="Task"/>. Null if the score cannot be found in the database.</returns>
/// <returns>The <see cref="Task"/>. Return <see cref="Task.CompletedTask"/> if the score cannot be found in the database.</returns>
/// <remarks>
/// The <see cref="IScoreInfo"/> is re-retrieved from the database to ensure all the required data
/// for exporting a replay are present (may have missing properties if it was retrieved from online data).
/// </remarks>
public Task? Export(ScoreInfo scoreInfo)
public Task Export(ScoreInfo scoreInfo)
{
ScoreInfo? databasedScoreInfo = getDatabasedScoreInfo(scoreInfo);
return databasedScoreInfo == null ? null : scoreExporter.ExportAsync(databasedScoreInfo.ToLive(Realm));
return databasedScoreInfo == null ? Task.CompletedTask : scoreExporter.ExportAsync(databasedScoreInfo.ToLive(Realm));
}
public Task<Live<ScoreInfo>?> ImportAsUpdate(ProgressNotification notification, ImportTask task, ScoreInfo original) => scoreImporter.ImportAsUpdate(notification, task, original);