From 25df42630ecba979457a9dcd2a7678d154a85a5e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Dec 2023 20:47:08 +0900 Subject: [PATCH] Improve performance of `attemptSelection` using new cached count and `LastSelected` --- osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs b/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs index 7f90e05744..8d2ddc5812 100644 --- a/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs +++ b/osu.Game/Screens/Select/Carousel/CarouselGroupEagerSelect.cs @@ -3,7 +3,6 @@ using System; using System.Collections.Generic; -using System.Linq; namespace osu.Game.Screens.Select.Carousel { @@ -101,7 +100,7 @@ namespace osu.Game.Screens.Select.Carousel if (State.Value != CarouselItemState.Selected) return; // we only perform eager selection if none of our items are in a selected state already. - if (Items.Any(i => i.State.Value == CarouselItemState.Selected)) return; + if (LastSelected?.State.Value == CarouselItemState.Selected || TotalItemsNotFiltered == 0) return; PerformSelection(); }