1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 16:12:57 +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 var columnsToDisplay = hitEventsAvailable
? row.Columns ? 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; panelIsEmpty = false;
else else
continue; continue;
@ -132,8 +132,8 @@ namespace osu.Game.Screens.Ranking.Statistics
Origin = Anchor.Centre, Origin = Anchor.Centre,
}).Cast<Drawable>().ToArray() }).Cast<Drawable>().ToArray()
}, },
ColumnDimensions = Enumerable.Range(0, columnsToDisplay?.Length ?? 0) ColumnDimensions = Enumerable.Range(0, columnsToDisplay.Length)
.Select(i => columnsToDisplay?[i].Dimension ?? new Dimension()).ToArray(), .Select(i => columnsToDisplay[i].Dimension ?? new Dimension()).ToArray(),
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) } RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) }
}); });
} }