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
@@ -72,13 +72,13 @@ namespace Ryujinx.HLE.HOS.Kernel.Common
servicePool = new MemoryRegion(DramMemoryMap.SlabHeapEnd, servicePoolSize);
return new[]
{
return
[
GetMemoryRegion(applicationPool),
GetMemoryRegion(appletPool),
GetMemoryRegion(servicePool),
GetMemoryRegion(nvServicesPool),
};
GetMemoryRegion(nvServicesPool)
];
}
private static KMemoryRegionManager GetMemoryRegion(MemoryRegion region)
@@ -10,12 +10,13 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc
{
class KServerSession : KSynchronizationObject
{
private static readonly MemoryState[] _ipcMemoryStates = {
private static readonly MemoryState[] _ipcMemoryStates =
[
MemoryState.IpcBuffer3,
MemoryState.IpcBuffer0,
MemoryState.IpcBuffer1,
(MemoryState)0xfffce5d4, //This is invalid, shouldn't be accessed.
};
(MemoryState)0xfffce5d4 //This is invalid, shouldn't be accessed.
];
private readonly struct Message
{
@@ -176,7 +177,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc
{
_parent = parent;
_requests = new LinkedList<KSessionRequest>();
_requests = [];
}
public Result EnqueueRequest(KSessionRequest request)
@@ -84,7 +84,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
}
}
private static readonly int[] _memoryBlockPageShifts = { 12, 16, 21, 22, 25, 29, 30 };
private static readonly int[] _memoryBlockPageShifts = [12, 16, 21, 22, 25, 29, 30];
#pragma warning disable IDE0052 // Remove unread private member
private readonly ulong _heapAddress;
@@ -13,14 +13,15 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
{
abstract class KPageTableBase
{
private static readonly int[] _mappingUnitSizes = {
private static readonly int[] _mappingUnitSizes =
[
0x1000,
0x10000,
0x200000,
0x400000,
0x2000000,
0x40000000,
};
0x40000000
];
private const ulong RegionAlignment = 0x200000;