mirror of
https://github.com/osukey/osukey.git
synced 2025-05-25 23:47:30 +09: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
|
fill.ChildrenEnumerable = controlPoints
|
||||||
.Where(matchFunction)
|
.Where(matchFunction)
|
||||||
.Select(createAttribute)
|
.Select(createAttribute)
|
||||||
.Where(c => c != null)
|
|
||||||
.Select(c => c!)
|
|
||||||
// arbitrary ordering to make timing points first.
|
// arbitrary ordering to make timing points first.
|
||||||
// probably want to explicitly define order in the future.
|
// probably want to explicitly define order in the future.
|
||||||
.OrderByDescending(c => c.GetType().Name);
|
.OrderByDescending(c => c.GetType().Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Drawable? createAttribute(ControlPoint controlPoint)
|
private Drawable createAttribute(ControlPoint controlPoint)
|
||||||
{
|
{
|
||||||
switch (controlPoint)
|
switch (controlPoint)
|
||||||
{
|
{
|
||||||
@ -179,10 +177,9 @@ namespace osu.Game.Screens.Edit.Timing
|
|||||||
|
|
||||||
case SampleControlPoint sample:
|
case SampleControlPoint sample:
|
||||||
return new SampleRowAttribute(sample);
|
return new SampleRowAttribute(sample);
|
||||||
|
|
||||||
default:
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(controlPoint), $"Control point type {controlPoint.GetType()} is not supported");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user