mirror of
https://github.com/ppy/osu
synced 2025-02-16 18:17:01 +00: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
|
||||
{
|
||||
private readonly Action<IScreen> finalAction;
|
||||
private readonly IEnumerable<Type> validScreens;
|
||||
private readonly Type[] validScreens;
|
||||
private readonly Func<IScreen> getCurrentScreen;
|
||||
|
||||
[Resolved]
|
||||
@ -53,7 +53,7 @@ namespace osu.Game
|
||||
validScreens = validScreens.Append(typeof(MainMenu));
|
||||
|
||||
this.finalAction = finalAction;
|
||||
this.validScreens = validScreens;
|
||||
this.validScreens = validScreens.ToArray();
|
||||
this.getCurrentScreen = getCurrentScreen;
|
||||
|
||||
Scheduler.Add(task = new ScheduledDelegate(checkCanComplete, 0, 200));
|
||||
|
Loading…
Reference in New Issue
Block a user