1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 12:33:01 +08:00

Remove useless null checks

This commit is contained in:
Henry Lin 2022-02-02 17:26:17 +08:00
parent 6a482827fe
commit 90e30bc9e8

View File

@ -110,9 +110,9 @@ namespace osu.Game.Screens.Ranking.Statistics
{
var columnsToDisplay = hitEventsAvailable
? row.Columns
: row.Columns?.Where(c => !c.RequiresHitEvents).ToArray();
: row.Columns.Where(c => !c.RequiresHitEvents).ToArray();
if (columnsToDisplay?.Any() ?? false)
if (columnsToDisplay.Any())
panelIsEmpty = false;
else
continue;
@ -132,8 +132,8 @@ namespace osu.Game.Screens.Ranking.Statistics
Origin = Anchor.Centre,
}).Cast<Drawable>().ToArray()
},
ColumnDimensions = Enumerable.Range(0, columnsToDisplay?.Length ?? 0)
.Select(i => columnsToDisplay?[i].Dimension ?? new Dimension()).ToArray(),
ColumnDimensions = Enumerable.Range(0, columnsToDisplay.Length)
.Select(i => columnsToDisplay[i].Dimension ?? new Dimension()).ToArray(),
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) }
});
}