mirror of
https://github.com/ppy/osu
synced 2025-01-20 21:10:49 +00:00
Avoid need for implicit null casting
This commit is contained in:
parent
0659c84341
commit
2a3b24d058
@ -157,14 +157,12 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
fill.ChildrenEnumerable = controlPoints
|
||||
.Where(matchFunction)
|
||||
.Select(createAttribute)
|
||||
.Where(c => c != null)
|
||||
.Select(c => c!)
|
||||
// arbitrary ordering to make timing points first.
|
||||
// probably want to explicitly define order in the future.
|
||||
.OrderByDescending(c => c.GetType().Name);
|
||||
}
|
||||
|
||||
private Drawable? createAttribute(ControlPoint controlPoint)
|
||||
private Drawable createAttribute(ControlPoint controlPoint)
|
||||
{
|
||||
switch (controlPoint)
|
||||
{
|
||||
@ -179,10 +177,9 @@ namespace osu.Game.Screens.Edit.Timing
|
||||
|
||||
case SampleControlPoint sample:
|
||||
return new SampleRowAttribute(sample);
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
throw new ArgumentOutOfRangeException(nameof(controlPoint), $"Control point type {controlPoint.GetType()} is not supported");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user