From 0ce7baa3f3e80b640cf6c8d07400bc3465509368 Mon Sep 17 00:00:00 2001 From: ekrctb Date: Mon, 31 May 2021 23:01:54 +0900 Subject: [PATCH] Make `HitObjectContainer.Clear` non-virtual It just call `Remove` for all entries. --- .../Objects/Pooling/PooledDrawableWithLifetimeContainer.cs | 3 ++- .../Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs | 7 ------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/osu.Game/Rulesets/Objects/Pooling/PooledDrawableWithLifetimeContainer.cs b/osu.Game/Rulesets/Objects/Pooling/PooledDrawableWithLifetimeContainer.cs index 5fe9d889a1..d35933dba8 100644 --- a/osu.Game/Rulesets/Objects/Pooling/PooledDrawableWithLifetimeContainer.cs +++ b/osu.Game/Rulesets/Objects/Pooling/PooledDrawableWithLifetimeContainer.cs @@ -145,10 +145,11 @@ namespace osu.Game.Rulesets.Objects.Pooling /// /// Remove all s. /// - public virtual void Clear() + public void Clear() { foreach (var entry in Entries.ToArray()) Remove(entry); + Debug.Assert(aliveDrawableMap.Count == 0); } diff --git a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs index cde4182f2d..b60aabe0e6 100644 --- a/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs +++ b/osu.Game/Rulesets/UI/Scrolling/ScrollingHitObjectContainer.cs @@ -45,13 +45,6 @@ namespace osu.Game.Rulesets.UI.Scrolling timeRange.ValueChanged += _ => layoutCache.Invalidate(); } - public override void Clear() - { - base.Clear(); - - layoutComputed.Clear(); - } - /// /// Given a position in screen space, return the time within this column. ///