misc: chore: Use collection expressions in HLE project

This commit is contained in:
Evan Husted
2025-01-26 15:43:02 -06:00
parent 3c2f283ec7
commit 70b767ef60
72 changed files with 312 additions and 299 deletions

View File

@@ -29,7 +29,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Common
_current2 = new long[(int)LimitableResource.Count];
_peak = new long[(int)LimitableResource.Count];
_waitingThreads = new LinkedList<KThread>();
_waitingThreads = [];
}
public bool Reserve(LimitableResource resource, ulong amount)

View File

@@ -9,7 +9,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Common
public KSynchronizationObject(KernelContext context) : base(context)
{
WaitingThreads = new LinkedList<KThread>();
WaitingThreads = [];
}
public LinkedListNode<KThread> AddWaitingThread(KThread thread)

View File

@@ -34,7 +34,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Common
public KTimeManager(KernelContext context)
{
_context = context;
_waitingObjects = new List<WaitingObject>();
_waitingObjects = [];
_keepRunning = true;
Thread work = new(WaitAndCheckScheduledObjects)

View File

@@ -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)