misc: chore: Use collection expressions

This commit is contained in:
KeatonTheBot 2025-03-06 20:46:29 -06:00
parent 4d5757417e
commit e2973a875a
236 changed files with 9843 additions and 7561 deletions

View file

@ -822,8 +822,8 @@ namespace Ryujinx.UI.Common.Configuration
EnableKeyboard = Hid.EnableKeyboard,
EnableMouse = Hid.EnableMouse,
Hotkeys = Hid.Hotkeys,
KeyboardConfig = new List<JsonObject>(),
ControllerConfig = new List<JsonObject>(),
KeyboardConfig = [],
ControllerConfig = [],
InputConfig = Hid.InputConfig,
GraphicsBackend = Graphics.GraphicsBackend,
PreferredGpu = Graphics.PreferredGpu,
@ -856,7 +856,7 @@ namespace Ryujinx.UI.Common.Configuration
Logger.EnableTrace.Value = false;
Logger.EnableGuest.Value = true;
Logger.EnableFsAccessLog.Value = false;
Logger.FilteredClasses.Value = Array.Empty<LogClass>();
Logger.FilteredClasses.Value = [];
Logger.GraphicsDebugLevel.Value = GraphicsDebugLevel.None;
System.Language.Value = Language.AmericanEnglish;
System.Region.Value = Region.USA;
@ -907,8 +907,8 @@ namespace Ryujinx.UI.Common.Configuration
UI.GuiColumns.PathColumn.Value = true;
UI.ColumnSort.SortColumnId.Value = 0;
UI.ColumnSort.SortAscending.Value = false;
UI.GameDirs.Value = new List<string>();
UI.AutoloadDirs.Value = new List<string>();
UI.GameDirs.Value = [];
UI.AutoloadDirs.Value = [];
UI.ShownFileTypes.NSP.Value = true;
UI.ShownFileTypes.PFS0.Value = true;
UI.ShownFileTypes.XCI.Value = true;
@ -945,8 +945,8 @@ namespace Ryujinx.UI.Common.Configuration
VolumeUp = Key.Unbound,
VolumeDown = Key.Unbound,
};
Hid.InputConfig.Value = new List<InputConfig>
{
Hid.InputConfig.Value =
[
new StandardKeyboardInputConfig
{
Version = InputConfig.CurrentVersion,
@ -994,8 +994,9 @@ namespace Ryujinx.UI.Common.Configuration
StickRight = Key.L,
StickButton = Key.H,
},
},
};
}
];
}
public void Load(ConfigurationFileFormat configurationFileFormat, string configurationFilePath)
@ -1174,8 +1175,8 @@ namespace Ryujinx.UI.Common.Configuration
{
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 24.");
configurationFileFormat.InputConfig = new List<InputConfig>
{
configurationFileFormat.InputConfig =
[
new StandardKeyboardInputConfig
{
Version = InputConfig.CurrentVersion,
@ -1223,8 +1224,9 @@ namespace Ryujinx.UI.Common.Configuration
StickRight = Key.L,
StickButton = Key.H,
},
},
};
}
];
configurationFileUpdated = true;
}
@ -1554,7 +1556,7 @@ namespace Ryujinx.UI.Common.Configuration
{
Ryujinx.Common.Logging.Logger.Warning?.Print(LogClass.Application, $"Outdated configuration version {configurationFileFormat.Version}, migrating to version 52.");
configurationFileFormat.AutoloadDirs = new();
configurationFileFormat.AutoloadDirs = [];
configurationFileUpdated = true;
}
@ -1708,7 +1710,7 @@ namespace Ryujinx.UI.Common.Configuration
if (Hid.InputConfig.Value == null)
{
Hid.InputConfig.Value = new List<InputConfig>();
Hid.InputConfig.Value = [];
}
Multiplayer.LanInterfaceId.Value = configurationFileFormat.MultiplayerLanInterfaceId;