1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:52:55 +08:00

Use IEnumerable.Where<>() rather than List.FindAll()

Saves a whole list allocation
This commit is contained in:
iiSaLMaN 2019-10-05 10:30:32 +03:00
parent 4f40a04425
commit ba1a854701

View File

@ -56,7 +56,7 @@ namespace osu.Game.Overlays.BeatmapSet
if (BeatmapSet != null)
{
Difficulties.ChildrenEnumerable = BeatmapSet.Beatmaps.FindAll(b => b.Ruleset.Equals(ruleset.Value)).OrderBy(b => b.StarDifficulty).Select(b => new DifficultySelectorButton(b)
Difficulties.ChildrenEnumerable = BeatmapSet.Beatmaps.Where(b => b.Ruleset.Equals(ruleset.Value)).OrderBy(b => b.StarDifficulty).Select(b => new DifficultySelectorButton(b)
{
State = DifficultySelectorState.NotSelected,
OnHovered = beatmap =>