1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 06:07:25 +08:00

Further fix nullability

This commit is contained in:
mk56-spn 2023-01-09 20:59:28 +01:00
parent 69260ca3c3
commit 6abbc7dc28
3 changed files with 8 additions and 10 deletions

View File

@ -739,7 +739,9 @@ namespace osu.Game.Screens.Select
foreach (var panel in Scroll.Children)
{
if (toDisplay.Remove(panel.Item!))
Debug.Assert(panel.Item != null);
if (toDisplay.Remove(panel.Item))
{
// panel already displayed.
continue;

View File

@ -2,7 +2,6 @@
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Diagnostics;
using osu.Framework.Bindables;
namespace osu.Game.Screens.Select.Carousel
@ -50,12 +49,7 @@ namespace osu.Game.Screens.Select.Carousel
public virtual int CompareTo(FilterCriteria criteria, CarouselItem other) => ItemID.CompareTo(other.ItemID);
public int CompareTo(CarouselItem? other)
{
Debug.Assert(other != null);
return CarouselYPosition.CompareTo(other.CarouselYPosition);
}
public int CompareTo(CarouselItem? other) => CarouselYPosition.CompareTo(other?.CarouselYPosition);
}
public enum CarouselItemState

View File

@ -146,7 +146,7 @@ namespace osu.Game.Screens.Select.Carousel
private void updateBeatmapDifficulties()
{
if (Item == null) return;
Debug.Assert(Item != null);
var carouselBeatmapSet = (CarouselBeatmapSet)Item;
@ -197,10 +197,12 @@ namespace osu.Game.Screens.Select.Carousel
foreach (var panel in beatmapContainer.Children)
{
Debug.Assert(panel.Item != null);
if (isSelected)
{
panel.MoveToY(yPos, 800, Easing.OutQuint);
yPos += panel.Item!.TotalHeight;
yPos += panel.Item.TotalHeight;
}
else
panel.MoveToY(0, 800, Easing.OutQuint);