misc: chore: Use collection expressions (part 2)

This commit is contained in:
KeatonTheBot
2025-03-10 21:32:01 -05:00
parent c923c0043a
commit 340ec79e9f
176 changed files with 308 additions and 308 deletions
+1 -1
View File
@@ -799,7 +799,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
try
{
(_virtualDependencies ??= new()).Add(virtualBuffer);
(_virtualDependencies ??= []).Add(virtualBuffer);
}
finally
{
@@ -61,8 +61,8 @@ namespace Ryujinx.Graphics.Gpu.Memory
_context = context;
_physicalMemory = physicalMemory;
_buffers = new RangeList<Buffer>();
_multiRangeBuffers = new MultiRangeList<MultiRangeBuffer>();
_buffers = [];
_multiRangeBuffers = [];
_bufferOverlaps = new Buffer[OverlapsBufferInitialCapacity];
@@ -395,7 +395,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
ulong dstOffset = 0;
HashSet<Buffer> physicalBuffers = new();
HashSet<Buffer> physicalBuffers = [];
for (int i = 0; i < virtualBuffer.Range.Count; i++)
{
@@ -1041,7 +1041,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
{
if (entry.Value.UnmappedSequence != entry.Value.Buffer.UnmappedSequence)
{
(toDelete ??= new()).Add(entry.Key);
(toDelete ??= []).Add(entry.Key);
}
}
@@ -141,9 +141,9 @@ namespace Ryujinx.Graphics.Gpu.Memory
_gpUniformBuffers[index] = new BuffersPerStage(Constants.TotalGpUniformBuffers);
}
_bufferTextures = new List<BufferTextureBinding>();
_bufferTextureArrays = new List<BufferTextureArrayBinding<ITextureArray>>();
_bufferImageArrays = new List<BufferTextureArrayBinding<IImageArray>>();
_bufferTextures = [];
_bufferTextureArrays = [];
_bufferImageArrays = [];
_ranges = new BufferAssignment[Constants.TotalGpUniformBuffers * Constants.ShaderStages];
}
@@ -27,7 +27,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// </summary>
public CounterCache()
{
_items = new List<CounterEntry>();
_items = [];
}
/// <summary>
@@ -128,7 +128,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// <param name="rangeSize">Size of the range in bytes</param>
public void AddPhysicalDependency(Buffer buffer, ulong rangeAddress, ulong dstOffset, ulong rangeSize)
{
(_dependencies ??= new()).Add(new(buffer, rangeAddress - buffer.Address, dstOffset, rangeSize));
(_dependencies ??= []).Add(new(buffer, rangeAddress - buffer.Address, dstOffset, rangeSize));
buffer.AddVirtualDependency(this);
}
@@ -17,7 +17,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
public void AddRemapAction(Action action)
{
RemapActions ??= new List<Action>();
RemapActions ??= [];
RemapActions.Add(action);
}
}
@@ -74,7 +74,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
public VirtualRangeCache(MemoryManager memoryManager)
{
_memoryManager = memoryManager;
_virtualRanges = new RangeList<VirtualRange>();
_virtualRanges = [];
_virtualRangeOverlaps = new VirtualRange[BufferCache.OverlapsBufferInitialCapacity];
_deferredUnmaps = new ConcurrentQueue<VirtualRange>();
}