1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 13:47:24 +08:00

Remove linq usage to kill allocations

This commit is contained in:
Bartłomiej Dach 2024-10-04 11:25:21 +02:00
parent 29418226c0
commit e136568a18
No known key found for this signature in database

View File

@ -3,7 +3,6 @@
#nullable disable
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Audio.Sample;
@ -47,10 +46,19 @@ namespace osu.Game.Graphics.UserInterface
{
base.Update();
bool showCheckboxes = Items.Any(i => i is StatefulMenuItem);
bool showCheckboxes = false;
foreach (var drawableItem in ItemsContainer.OfType<DrawableOsuMenuItem>())
drawableItem.ShowCheckbox.Value = showCheckboxes;
foreach (var drawableItem in ItemsContainer)
{
if (drawableItem.Item is StatefulMenuItem)
showCheckboxes = true;
}
foreach (var drawableItem in ItemsContainer)
{
if (drawableItem is DrawableOsuMenuItem osuItem)
osuItem.ShowCheckbox.Value = showCheckboxes;
}
}
protected override void AnimateOpen()