1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 17:27:24 +08:00

Uncomment net6.0 code and remove old code

This commit is contained in:
Susko3 2023-12-04 20:17:22 +01:00
parent f0364f01ea
commit 0e47492858

View File

@ -183,9 +183,7 @@ namespace osu.Game.Overlays
// new results may contain beatmaps from a previous page,
// this is dodgy but matches web behaviour for now.
// see: https://github.com/ppy/osu-web/issues/9270
// todo: replace custom equality compraer with ExceptBy in net6.0
// newCards = newCards.ExceptBy(foundContent.Select(c => c.BeatmapSet.OnlineID), c => c.BeatmapSet.OnlineID);
newCards = newCards.Except(foundContent, BeatmapCardEqualityComparer.Default);
newCards = newCards.ExceptBy(foundContent.Select(c => c.BeatmapSet.OnlineID), c => c.BeatmapSet.OnlineID);
panelLoadTask = LoadComponentsAsync(newCards, loaded =>
{
@ -378,21 +376,5 @@ namespace osu.Game.Overlays
if (shouldShowMore)
filterControl.FetchNextPage();
}
private class BeatmapCardEqualityComparer : IEqualityComparer<BeatmapCard>
{
public static BeatmapCardEqualityComparer Default { get; } = new BeatmapCardEqualityComparer();
public bool Equals(BeatmapCard x, BeatmapCard y)
{
if (ReferenceEquals(x, y)) return true;
if (ReferenceEquals(x, null)) return false;
if (ReferenceEquals(y, null)) return false;
return x.BeatmapSet.Equals(y.BeatmapSet);
}
public int GetHashCode(BeatmapCard obj) => obj.BeatmapSet.GetHashCode();
}
}
}