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

@@ -24,7 +24,7 @@ namespace Ryujinx.HLE.HOS.Ipc
PId = HasPId ? reader.ReadUInt64() : 0;
int toCopySize = (word >> 1) & 0xf;
int[] toCopy = toCopySize == 0 ? Array.Empty<int>() : new int[toCopySize];
int[] toCopy = toCopySize == 0 ? [] : new int[toCopySize];
for (int index = 0; index < toCopy.Length; index++)
{
@@ -34,7 +34,7 @@ namespace Ryujinx.HLE.HOS.Ipc
ToCopy = toCopy;
int toMoveSize = (word >> 5) & 0xf;
int[] toMove = toMoveSize == 0 ? Array.Empty<int>() : new int[toMoveSize];
int[] toMove = toMoveSize == 0 ? [] : new int[toMoveSize];
for (int index = 0; index < toMove.Length; index++)
{
@@ -59,12 +59,12 @@ namespace Ryujinx.HLE.HOS.Ipc
public static IpcHandleDesc MakeCopy(params int[] handles)
{
return new IpcHandleDesc(handles, Array.Empty<int>());
return new IpcHandleDesc(handles, []);
}
public static IpcHandleDesc MakeMove(params int[] handles)
{
return new IpcHandleDesc(Array.Empty<int>(), handles);
return new IpcHandleDesc([], handles);
}
public RecyclableMemoryStream GetStream()