Use pattern matching instead of .(Has)?Value

This commit is contained in:
Bartłomiej Dach 2020-02-23 14:46:42 +01:00
parent 63006e8672
commit 71c34a36ed

View File

@ -163,14 +163,14 @@ namespace osu.Game.Overlays
BeatmapSet.BindValueChanged(beatmapSet =>
{
if (beatmapSet.NewValue?.OnlineBeatmapSetID.HasValue != true)
if (beatmapSet.NewValue?.OnlineBeatmapSetID is int onlineBeatmapSetID)
{
Hide();
Show();
comments.ShowComments(CommentableType.Beatmapset, onlineBeatmapSetID);
}
else
{
Show();
comments.ShowComments(CommentableType.Beatmapset, beatmapSet.NewValue.OnlineBeatmapSetID.Value);
Hide();
}
}, true);
}