1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-05 02:23:38 +08:00

Improve performance of attemptSelection using new cached count and LastSelected

This commit is contained in:
Dean Herbert
2023-12-18 20:47:08 +09:00
Unverified
parent 5755fa214a
commit 25df42630e
@@ -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();
}