Debounce calls to UpdateTernaryStates

Just something I noticed in passing recently which may help with
reducing performance overhead of some batch operations.
This commit is contained in:
Dean Herbert
2020-11-03 01:08:35 +09:00
parent 3765c8abb9
commit ab308d28d2

View File

@ -419,11 +419,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
}; };
// bring in updates from selection changes // bring in updates from selection changes
EditorBeatmap.HitObjectUpdated += _ => UpdateTernaryStates(); EditorBeatmap.HitObjectUpdated += _ => Scheduler.AddOnce(UpdateTernaryStates);
EditorBeatmap.SelectedHitObjects.CollectionChanged += (sender, args) => EditorBeatmap.SelectedHitObjects.CollectionChanged += (sender, args) =>
{ {
Scheduler.AddOnce(updateVisibility); Scheduler.AddOnce(updateVisibility);
UpdateTernaryStates(); Scheduler.AddOnce(UpdateTernaryStates);
}; };
} }