From c3fa97d062c370c4d5c60b2cee66e7b8298a79b7 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Sun, 25 Feb 2024 18:02:42 +0300 Subject: [PATCH] Reduce allocations in HitObjectLifetimeEntry --- .../Rulesets/Objects/HitObjectLifetimeEntry.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Objects/HitObjectLifetimeEntry.cs b/osu.Game/Rulesets/Objects/HitObjectLifetimeEntry.cs index 4450f026b4..9f2720b7ca 100644 --- a/osu.Game/Rulesets/Objects/HitObjectLifetimeEntry.cs +++ b/osu.Game/Rulesets/Objects/HitObjectLifetimeEntry.cs @@ -41,7 +41,22 @@ namespace osu.Game.Rulesets.Objects /// /// Whether and all of its nested objects have been judged. /// - public bool AllJudged => Judged && NestedEntries.All(h => h.AllJudged); + public bool AllJudged + { + get + { + if (!Judged) + return false; + + foreach (var entry in NestedEntries) + { + if (!entry.AllJudged) + return false; + } + + return true; + } + } private readonly IBindable startTimeBindable = new BindableDouble();