From df850924262e726c5b4c5d71a159314dad55e769 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 27 Sep 2021 14:24:17 +0900 Subject: [PATCH] Resolve inner items early in process and rename variable --- .../HitObjectOrderedSelectionContainer.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/osu.Game/Screens/Edit/Compose/Components/HitObjectOrderedSelectionContainer.cs b/osu.Game/Screens/Edit/Compose/Components/HitObjectOrderedSelectionContainer.cs index e8286c5128..3fc26fa974 100644 --- a/osu.Game/Screens/Edit/Compose/Components/HitObjectOrderedSelectionContainer.cs +++ b/osu.Game/Screens/Edit/Compose/Components/HitObjectOrderedSelectionContainer.cs @@ -41,25 +41,25 @@ namespace osu.Game.Screens.Edit.Compose.Components protected override int Compare(Drawable x, Drawable y) { - var xObj = (SelectionBlueprint)x; - var yObj = (SelectionBlueprint)y; + var xObj = ((SelectionBlueprint)x).Item; + var yObj = ((SelectionBlueprint)y).Item; // Put earlier blueprints towards the end of the list, so they handle input first - int i = yObj.Item.StartTime.CompareTo(xObj.Item.StartTime); - if (i != 0) return i; + int result = yObj.StartTime.CompareTo(xObj.StartTime); + if (result != 0) return result; // Fall back to end time if the start time is equal. - i = yObj.Item.GetEndTime().CompareTo(xObj.Item.GetEndTime()); - if (i != 0) return i; + result = yObj.GetEndTime().CompareTo(xObj.GetEndTime()); + if (result != 0) return result; // As a final fallback, use combo information if available. - if (xObj.Item is IHasComboInformation xHasCombo && yObj.Item is IHasComboInformation yHasCombo) + if (xObj is IHasComboInformation xHasCombo && yObj is IHasComboInformation yHasCombo) { - i = yHasCombo.ComboIndex.CompareTo(xHasCombo.ComboIndex); - if (i != 0) return i; + result = yHasCombo.ComboIndex.CompareTo(xHasCombo.ComboIndex); + if (result != 0) return result; - i = yHasCombo.IndexInCurrentCombo.CompareTo(xHasCombo.IndexInCurrentCombo); - if (i != 0) return i; + result = yHasCombo.IndexInCurrentCombo.CompareTo(xHasCombo.IndexInCurrentCombo); + if (result != 0) return result; } return CompareReverseChildID(y, x);