mirror of
https://github.com/ppy/osu
synced 2024-12-27 09:23:15 +00:00
Reduce allocations in ModColumn
This commit is contained in:
parent
5e7f0bd94f
commit
3b53ed3c3a
@ -67,8 +67,25 @@ namespace osu.Game.Overlays.Mods
|
||||
private IModHotkeyHandler hotkeyHandler = null!;
|
||||
|
||||
private Task? latestLoadTask;
|
||||
private ICollection<ModPanel>? latestLoadedPanels;
|
||||
internal bool ItemsLoaded => latestLoadTask?.IsCompleted == true && latestLoadedPanels?.All(panel => panel.Parent != null) == true;
|
||||
private ModPanel[]? latestLoadedPanels;
|
||||
internal bool ItemsLoaded => latestLoadTask?.IsCompleted == true && allPanelsLoaded;
|
||||
|
||||
private bool allPanelsLoaded
|
||||
{
|
||||
get
|
||||
{
|
||||
if (latestLoadedPanels == null)
|
||||
return false;
|
||||
|
||||
foreach (var panel in latestLoadedPanels)
|
||||
{
|
||||
if (panel.Parent == null)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsPresent => base.IsPresent || Scheduler.HasPendingTasks;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user