1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-17 03:52:35 +08:00

Avoid empty list allocation

This commit is contained in:
ekrctb
2021-04-12 18:49:38 +09:00
Unverified
parent f1b8171e38
commit 6d18b3db00
+4 -1
View File
@@ -102,10 +102,13 @@ namespace osu.Game.Rulesets.UI
#endregion
// to avoid allocation
private readonly List<IInput> emptyInputList = new List<IInput>();
protected override List<IInput> GetPendingInputs()
{
if (replayInputHandler != null && !replayInputHandler.IsActive)
return new List<IInput>();
return emptyInputList;
return base.GetPendingInputs();
}