mirror of
https://github.com/osukey/osukey.git
synced 2025-06-14 07:47:59 +09:00
Avoid multiple enumeration by converting to array at construction time
This commit is contained in:
parent
b28a0d5cd5
commit
ad79c2bc62
@ -20,7 +20,7 @@ namespace osu.Game
|
|||||||
internal class PerformFromMenuRunner : Component
|
internal class PerformFromMenuRunner : Component
|
||||||
{
|
{
|
||||||
private readonly Action<IScreen> finalAction;
|
private readonly Action<IScreen> finalAction;
|
||||||
private readonly IEnumerable<Type> validScreens;
|
private readonly Type[] validScreens;
|
||||||
private readonly Func<IScreen> getCurrentScreen;
|
private readonly Func<IScreen> getCurrentScreen;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
@ -53,7 +53,7 @@ namespace osu.Game
|
|||||||
validScreens = validScreens.Append(typeof(MainMenu));
|
validScreens = validScreens.Append(typeof(MainMenu));
|
||||||
|
|
||||||
this.finalAction = finalAction;
|
this.finalAction = finalAction;
|
||||||
this.validScreens = validScreens;
|
this.validScreens = validScreens.ToArray();
|
||||||
this.getCurrentScreen = getCurrentScreen;
|
this.getCurrentScreen = getCurrentScreen;
|
||||||
|
|
||||||
Scheduler.Add(task = new ScheduledDelegate(checkCanComplete, 0, 200));
|
Scheduler.Add(task = new ScheduledDelegate(checkCanComplete, 0, 200));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user