1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 00:02:54 +08:00

use GroupBy instead of Distinct+FindAll

This commit is contained in:
Dean Herbert 2019-08-25 12:00:06 +09:00
parent 1d34124667
commit ef397434f6

View File

@ -118,8 +118,8 @@ namespace osu.Game.Screens.Select.Carousel
if (beatmaps.Count > maximum_difficulty_icons)
{
foreach (var ruleset in beatmaps.Select(b => b.Beatmap.Ruleset).Distinct())
icons.Add(new FilterableGroupedDifficultyIcon(beatmaps.FindAll(b => b.Beatmap.Ruleset.Equals(ruleset)), ruleset));
foreach (var group in beatmaps.GroupBy(b => b.Beatmap.Ruleset))
icons.Add(new FilterableGroupedDifficultyIcon(group.ToList(), group.Key));
}
else beatmaps.ForEach(b => icons.Add(new FilterableDifficultyIcon(b)));