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
+7 -7
View File
@@ -122,7 +122,7 @@ namespace Ryujinx.Tests.Unicorn
}
private static readonly int[] _xRegisters =
{
[
Arm.UC_ARM_REG_R0,
Arm.UC_ARM_REG_R1,
Arm.UC_ARM_REG_R2,
@@ -138,12 +138,12 @@ namespace Ryujinx.Tests.Unicorn
Arm.UC_ARM_REG_R12,
Arm.UC_ARM_REG_R13,
Arm.UC_ARM_REG_R14,
Arm.UC_ARM_REG_R15,
};
Arm.UC_ARM_REG_R15
];
#pragma warning disable IDE0051, IDE0052 // Remove unused private member
private static readonly int[] _qRegisters =
{
[
Arm.UC_ARM_REG_Q0,
Arm.UC_ARM_REG_Q1,
Arm.UC_ARM_REG_Q2,
@@ -159,8 +159,8 @@ namespace Ryujinx.Tests.Unicorn
Arm.UC_ARM_REG_Q12,
Arm.UC_ARM_REG_Q13,
Arm.UC_ARM_REG_Q14,
Arm.UC_ARM_REG_Q15,
};
Arm.UC_ARM_REG_Q15
];
#pragma warning restore IDE0051, IDE0052
public uint GetX(int index)
@@ -259,7 +259,7 @@ namespace Ryujinx.Tests.Unicorn
Uc.MemWrite((long)address, value);
}
public void MemoryWrite8(ulong address, byte value) => MemoryWrite(address, new[] { value });
public void MemoryWrite8(ulong address, byte value) => MemoryWrite(address, [value]);
public void MemoryWrite16(ulong address, short value) => MemoryWrite(address, BitConverter.GetBytes(value));
public void MemoryWrite16(ulong address, ushort value) => MemoryWrite(address, BitConverter.GetBytes(value));
public void MemoryWrite32(ulong address, int value) => MemoryWrite(address, BitConverter.GetBytes(value));
+7 -7
View File
@@ -111,7 +111,7 @@ namespace Ryujinx.Tests.Unicorn
}
private static readonly int[] _xRegisters =
{
[
Arm64.UC_ARM64_REG_X0,
Arm64.UC_ARM64_REG_X1,
Arm64.UC_ARM64_REG_X2,
@@ -142,11 +142,11 @@ namespace Ryujinx.Tests.Unicorn
Arm64.UC_ARM64_REG_X27,
Arm64.UC_ARM64_REG_X28,
Arm64.UC_ARM64_REG_X29,
Arm64.UC_ARM64_REG_X30,
};
Arm64.UC_ARM64_REG_X30
];
private static readonly int[] _qRegisters =
{
[
Arm64.UC_ARM64_REG_Q0,
Arm64.UC_ARM64_REG_Q1,
Arm64.UC_ARM64_REG_Q2,
@@ -178,8 +178,8 @@ namespace Ryujinx.Tests.Unicorn
Arm64.UC_ARM64_REG_Q28,
Arm64.UC_ARM64_REG_Q29,
Arm64.UC_ARM64_REG_Q30,
Arm64.UC_ARM64_REG_Q31,
};
Arm64.UC_ARM64_REG_Q31
];
public ulong GetX(int index)
{
@@ -272,7 +272,7 @@ namespace Ryujinx.Tests.Unicorn
Uc.MemWrite((long)address, value);
}
public void MemoryWrite8(ulong address, byte value) => MemoryWrite(address, new[] { value });
public void MemoryWrite8(ulong address, byte value) => MemoryWrite(address, [value]);
public void MemoryWrite16(ulong address, short value) => MemoryWrite(address, BitConverter.GetBytes(value));
public void MemoryWrite16(ulong address, ushort value) => MemoryWrite(address, BitConverter.GetBytes(value));
public void MemoryWrite32(ulong address, int value) => MemoryWrite(address, BitConverter.GetBytes(value));