mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-04 14:49:28 +02:00
misc: chore: Use collection expressions (part 2)
This commit is contained in:
@@ -27,7 +27,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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -16,8 +16,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc
|
||||
{
|
||||
_parent = parent;
|
||||
|
||||
_incomingConnections = new LinkedList<KServerSession>();
|
||||
_lightIncomingConnections = new LinkedList<KLightServerSession>();
|
||||
_incomingConnections = [];
|
||||
_lightIncomingConnections = [];
|
||||
}
|
||||
|
||||
public void EnqueueIncomingSession(KServerSession session)
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
||||
|
||||
public KPageList()
|
||||
{
|
||||
Nodes = new LinkedList<KPageNode>();
|
||||
Nodes = [];
|
||||
}
|
||||
|
||||
public Result AddRange(ulong address, ulong pagesCount)
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
|
||||
|
||||
public KSlabHeap(ulong pa, ulong itemSize, ulong size)
|
||||
{
|
||||
_items = new LinkedList<ulong>();
|
||||
_items = [];
|
||||
|
||||
int itemsCount = (int)(size / itemSize);
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||
{
|
||||
_owner = owner;
|
||||
|
||||
_images = new List<Image>();
|
||||
_images = [];
|
||||
}
|
||||
|
||||
public string GetGuestStackTrace(KThread thread)
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process
|
||||
// TODO: Remove once we no longer need to initialize it externally.
|
||||
HandleTable = new KHandleTable();
|
||||
|
||||
_threads = new LinkedList<KThread>();
|
||||
_threads = [];
|
||||
|
||||
Debugger = new HleProcessDebugger(this);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||
{
|
||||
_context = context;
|
||||
|
||||
_condVarThreads = new List<KThread>();
|
||||
_arbiterThreads = new List<KThread>();
|
||||
_condVarThreads = [];
|
||||
_arbiterThreads = [];
|
||||
}
|
||||
|
||||
public Result ArbitrateLock(int ownerHandle, ulong mutexAddress, int requesterHandle)
|
||||
|
||||
@@ -23,8 +23,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||
|
||||
for (int core = 0; core < KScheduler.CpuCoresCount; core++)
|
||||
{
|
||||
_suggestedThreadsPerPrioPerCore[prio][core] = new LinkedList<KThread>();
|
||||
_scheduledThreadsPerPrioPerCore[prio][core] = new LinkedList<KThread>();
|
||||
_suggestedThreadsPerPrioPerCore[prio][core] = [];
|
||||
_scheduledThreadsPerPrioPerCore[prio][core] = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -121,8 +121,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
|
||||
|
||||
SiblingsPerCore = new LinkedListNode<KThread>[KScheduler.CpuCoresCount];
|
||||
|
||||
_mutexWaiters = new LinkedList<KThread>();
|
||||
_pinnedWaiters = new LinkedList<KThread>();
|
||||
_mutexWaiters = [];
|
||||
_pinnedWaiters = [];
|
||||
}
|
||||
|
||||
public Result Initialize(
|
||||
|
||||
Reference in New Issue
Block a user