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

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

View file

@ -10,7 +10,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory
public KPageList()
{
Nodes = new LinkedList<KPageNode>();
Nodes = [];
}
public Result AddRange(ulong address, ulong pagesCount)

View file

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

View file

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