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

@ -34,14 +34,14 @@ namespace Ryujinx.Horizon.Kernel.Generators
private const string TypeResult = NamespaceHorizonCommon + "." + TypeResultName;
private const string TypeExecutionContext = "IExecutionContext";
private static readonly string[] _expectedResults = new string[]
{
private static readonly string[] _expectedResults =
[
$"{TypeResultName}.Success",
$"{TypeKernelResultName}.TimedOut",
$"{TypeKernelResultName}.Cancelled",
$"{TypeKernelResultName}.PortRemoteClosed",
$"{TypeKernelResultName}.InvalidState",
};
$"{TypeKernelResultName}.InvalidState"
];
private readonly struct OutParameter
{
@ -145,7 +145,7 @@ namespace Ryujinx.Horizon.Kernel.Generators
GenerateResultCheckHelper(generator);
generator.AppendLine();
List<SyscallIdAndName> syscalls = new List<SyscallIdAndName>();
List<SyscallIdAndName> syscalls = [];
foreach (var method in syntaxReceiver.SvcImplementations)
{
@ -202,9 +202,9 @@ namespace Ryujinx.Horizon.Kernel.Generators
RegisterAllocatorA32 regAlloc = new RegisterAllocatorA32();
List<OutParameter> outParameters = new List<OutParameter>();
List<string> logInArgs = new List<string>();
List<string> logOutArgs = new List<string>();
List<OutParameter> outParameters = [];
List<string> logInArgs = [];
List<string> logOutArgs = [];
foreach (var methodParameter in method.ParameterList.Parameters)
{
@ -321,9 +321,9 @@ namespace Ryujinx.Horizon.Kernel.Generators
int registerIndex = 0;
int index = 0;
List<OutParameter> outParameters = new List<OutParameter>();
List<string> logInArgs = new List<string>();
List<string> logOutArgs = new List<string>();
List<OutParameter> outParameters = [];
List<string> logInArgs = [];
List<string> logOutArgs = [];
foreach (var methodParameter in method.ParameterList.Parameters)
{