From 340ec79e9f959549c5b9f4723eb6ec4d3a865c55 Mon Sep 17 00:00:00 2001 From: KeatonTheBot Date: Mon, 10 Mar 2025 21:32:01 -0500 Subject: [PATCH] misc: chore: Use collection expressions (part 2) --- .../CodeGen/Arm64/CodeGenerator.cs | 2 +- .../RegisterAllocators/CopyResolver.cs | 4 +-- .../RegisterAllocators/LinearScanAllocator.cs | 6 ++-- src/ARMeilleure/CodeGen/X86/Assembler.cs | 4 +-- src/ARMeilleure/CodeGen/X86/CodeGenerator.cs | 2 +- src/ARMeilleure/Common/ArenaAllocator.cs | 4 +-- src/ARMeilleure/Decoders/Block.cs | 2 +- src/ARMeilleure/Decoders/Decoder.cs | 2 +- src/ARMeilleure/Decoders/OpCodeT16IfThen.cs | 2 +- src/ARMeilleure/Decoders/OpCodeTable.cs | 8 ++--- src/ARMeilleure/Diagnostics/Symbols.cs | 2 +- .../IntermediateRepresentation/BasicBlock.cs | 4 +-- .../Translation/Cache/CacheMemoryAllocator.cs | 2 +- src/ARMeilleure/Translation/Cache/JitCache.cs | 4 +-- src/ARMeilleure/Translation/IntervalTree.cs | 2 +- .../Translation/PTC/PtcFormatter.cs | 2 +- .../Translation/PTC/PtcProfiler.cs | 2 +- .../Translation/TranslatorQueue.cs | 2 +- .../Renderer/Dsp/Command/CommandList.cs | 2 +- .../Collections/TreeDictionary.cs | 4 +-- .../Configuration/ModMetadata.cs | 2 +- src/Ryujinx.Common/Logging/Logger.cs | 2 +- .../PreciseSleep/NanosleepPool.cs | 4 +-- .../PreciseSleep/WindowsGranularTimer.cs | 2 +- src/Ryujinx.Cpu/AddressTable.cs | 2 +- .../HostTracked/AddressSpacePartitioned.cs | 2 +- .../LightningJit/Arm32/CodeGenContext.cs | 2 +- src/Ryujinx.Cpu/LightningJit/Arm32/Decoder.cs | 6 ++-- src/Ryujinx.Cpu/LightningJit/Arm64/Block.cs | 4 +-- .../LightningJit/Arm64/MultiBlock.cs | 4 +-- .../Arm64/Target/Arm64/Compiler.cs | 2 +- .../Arm64/Target/Arm64/Decoder.cs | 6 ++-- .../Cache/CacheMemoryAllocator.cs | 2 +- .../LightningJit/Cache/JitCache.cs | 4 +-- .../LightningJit/Cache/NoWxCache.cs | 2 +- .../Cache/PageAlignedRangeList.cs | 4 +-- .../LightningJit/CodeGen/Arm64/Assembler.cs | 2 +- .../LightningJit/CodeGen/Arm64/StackWalker.cs | 2 +- .../LightningJit/CodeGen/Arm64/TailMerger.cs | 2 +- src/Ryujinx.Cpu/LightningJit/CodeWriter.cs | 2 +- .../LightningJit/Table/InstTableLevel.cs | 2 +- .../LightningJit/TranslatorStubs.cs | 2 +- .../Multithreading/BufferMap.cs | 2 +- .../Multithreading/Resources/ProgramQueue.cs | 2 +- .../Multithreading/SyncMap.cs | 2 +- .../Engine/Threed/Blender/UcodeAssembler.cs | 2 +- src/Ryujinx.Graphics.Gpu/GpuContext.cs | 6 ++-- .../Image/AutoDeleteCache.cs | 6 ++-- src/Ryujinx.Graphics.Gpu/Image/PoolCache.cs | 2 +- src/Ryujinx.Graphics.Gpu/Image/Texture.cs | 4 +-- .../Image/TextureBindingsArrayCache.cs | 4 +-- .../Image/TextureCache.cs | 8 ++--- .../Image/TextureGroupHandle.cs | 4 +-- src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs | 2 +- src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs | 2 +- .../Memory/BufferCache.cs | 8 ++--- .../Memory/BufferManager.cs | 6 ++-- .../Memory/CounterCache.cs | 2 +- .../Memory/MultiRangeBuffer.cs | 2 +- .../Memory/UnmapEventArgs.cs | 2 +- .../Memory/VirtualRangeCache.cs | 2 +- .../Shader/ComputeShaderCacheHashTable.cs | 4 +-- .../Shader/DiskCache/DiskCacheGuestStorage.cs | 2 +- .../DiskCache/ShaderBinarySerializer.cs | 2 +- .../Shader/HashTable/PartitionedHashTable.cs | 2 +- .../Shader/ShaderCacheHashTable.cs | 2 +- .../Shader/ShaderInfoBuilder.cs | 8 ++--- .../Shader/ShaderSpecializationList.cs | 2 +- .../Synchronization/Syncpoint.cs | 4 +-- .../SyncptIncrManager.cs | 2 +- .../Image/IntermmediatePool.cs | 2 +- src/Ryujinx.Graphics.OpenGL/ResourcePool.cs | 2 +- src/Ryujinx.Graphics.OpenGL/Sync.cs | 2 +- .../CodeGen/Spirv/CodeGenContext.cs | 2 +- .../CodeGen/Spirv/Declarations.cs | 2 +- src/Ryujinx.Graphics.Shader/Decoders/Block.cs | 8 ++--- .../Decoders/DecodedFunction.cs | 2 +- .../Decoders/DecodedProgram.cs | 2 +- .../Decoders/Decoder.cs | 8 ++--- .../Instructions/InstEmitSurface.cs | 8 ++--- .../IntermediateRepresentation/BasicBlock.cs | 6 ++-- .../IntermediateRepresentation/Operand.cs | 2 +- .../IntermediateRepresentation/PhiNode.cs | 4 +-- .../StructuredIr/AstBlock.cs | 2 +- .../StructuredIr/AstOperand.cs | 4 +-- .../StructuredIr/GotoElimination.cs | 2 +- .../StructuredIr/StructuredFunction.cs | 2 +- .../StructuredIr/StructuredProgram.cs | 2 +- .../StructuredIr/StructuredProgramInfo.cs | 4 +-- .../Translation/AttributeUsage.cs | 4 +-- .../Translation/ControlFlowGraph.cs | 4 +-- .../Translation/RegisterUsage.cs | 4 +-- src/Ryujinx.Graphics.Vulkan/BarrierBatch.cs | 6 ++-- src/Ryujinx.Graphics.Vulkan/BufferHolder.cs | 2 +- src/Ryujinx.Graphics.Vulkan/CacheByRange.cs | 6 ++-- .../CommandBufferPool.cs | 4 +-- .../HostMemoryAllocator.cs | 2 +- src/Ryujinx.Graphics.Vulkan/IdList.cs | 2 +- src/Ryujinx.Graphics.Vulkan/ImageArray.cs | 2 +- .../MemoryAllocator.cs | 2 +- src/Ryujinx.Graphics.Vulkan/PipelineFull.cs | 8 ++--- .../PipelineLayoutCacheEntry.cs | 4 +-- .../RenderPassHolder.cs | 2 +- .../ResourceLayoutBuilder.cs | 4 +-- src/Ryujinx.Graphics.Vulkan/SyncManager.cs | 2 +- src/Ryujinx.Graphics.Vulkan/TextureArray.cs | 2 +- .../ServiceSyntaxReceiver.cs | 2 +- .../HOS/Applets/Browser/BrowserArgument.cs | 2 +- .../HOS/Diagnostics/Demangler/Demangler.cs | 30 +++++++++---------- src/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs | 14 ++++----- .../HOS/Kernel/Common/KResourceLimit.cs | 2 +- .../Kernel/Common/KSynchronizationObject.cs | 2 +- .../HOS/Kernel/Common/KTimeManager.cs | 2 +- src/Ryujinx.HLE/HOS/Kernel/Ipc/KServerPort.cs | 4 +-- .../HOS/Kernel/Memory/KPageList.cs | 2 +- .../HOS/Kernel/Memory/KSlabHeap.cs | 2 +- .../HOS/Kernel/Process/HleProcessDebugger.cs | 2 +- .../HOS/Kernel/Process/KProcess.cs | 2 +- .../HOS/Kernel/Threading/KAddressArbiter.cs | 4 +-- .../HOS/Kernel/Threading/KPriorityQueue.cs | 4 +-- .../HOS/Kernel/Threading/KThread.cs | 4 +-- .../Account/Acc/AccountSaveDataManager.cs | 2 +- .../HOS/Services/Hid/IHidServer.cs | 4 +-- .../LdnRyu/Proxy/EphemeralPortPool.cs | 2 +- .../LdnRyu/Proxy/LdnProxy.cs | 2 +- .../LdnRyu/Proxy/LdnProxySocket.cs | 2 +- .../LdnRyu/Proxy/P2pProxyServer.cs | 4 +-- .../Nfc/AmiiboDecryption/AmiiboDump.cs | 2 +- .../GeneralService/GeneralServiceManager.cs | 2 +- .../Services/Ns/Aoc/IAddOnContentManager.cs | 2 +- .../HOS/Services/Nv/NvMemoryAllocator.cs | 2 +- .../HOS/Services/Ro/IRoInterface.cs | 2 +- .../QueryPlayStatisticsManager.cs | 2 +- .../HOS/Services/Sockets/Bsd/BsdContext.cs | 4 +-- .../Impl/EventFileDescriptorPollManager.cs | 2 +- .../Bsd/Impl/ManagedSocketPollManager.cs | 12 ++++---- .../Services/Sockets/Sfdnsres/IResolver.cs | 2 +- .../SurfaceFlinger/BufferQueueCore.cs | 2 +- .../Clock/SystemClockContextUpdateCallback.cs | 2 +- .../RootService/IApplicationDisplayService.cs | 2 +- src/Ryujinx.HLE/HOS/Tamper/OperationBlock.cs | 2 +- src/Ryujinx.Headless.SDL2/Program.cs | 2 +- .../Hipc/CommandInterface.cs | 2 +- .../Hipc/HipcGenerator.cs | 2 +- .../Hipc/HipcSyntaxReceiver.cs | 2 +- .../SyscallSyntaxReceiver.cs | 2 +- src/Ryujinx.Horizon/HeapAllocator.cs | 2 +- src/Ryujinx.Horizon/MmNv/Ipc/Request.cs | 2 +- .../Friends/Detail/Ipc/NotificationService.cs | 2 +- .../Sdk/OsTypes/Impl/MultiWaitImpl.cs | 2 +- src/Ryujinx.Horizon/Sdk/OsTypes/OsEvent.cs | 2 +- .../Sdk/Sf/Cmif/ServerDomainManager.cs | 6 ++-- .../Sdk/Sf/Hipc/ServerManager.cs | 4 +-- src/Ryujinx.Horizon/ServiceTable.cs | 2 +- src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs | 2 +- src/Ryujinx.Input/HLE/NpadManager.cs | 2 +- src/Ryujinx.Memory/SparseMemoryBlock.cs | 2 +- src/Ryujinx.Memory/Tracking/MemoryTracking.cs | 6 ++-- src/Ryujinx.Memory/Tracking/VirtualRegion.cs | 2 +- src/Ryujinx.Tests.Memory/TrackingTests.cs | 2 +- .../App/ApplicationLibrary.cs | 6 ++-- .../Helper/CommandLineState.cs | 2 +- .../Helper/DownloadableContentsHelper.cs | 2 +- src/Ryujinx/Input/AvaloniaKeyboard.cs | 2 +- .../Controls/ApplicationContextMenu.axaml.cs | 8 ++--- .../UI/Controls/NavigationDialogHost.axaml.cs | 2 +- src/Ryujinx/UI/Models/CheatNode.cs | 2 +- .../UI/ViewModels/AmiiboWindowViewModel.cs | 6 ++-- .../UI/ViewModels/ModManagerViewModel.cs | 6 ++-- .../UI/ViewModels/SettingsViewModel.cs | 10 +++---- .../UserFirmwareAvatarSelectorViewModel.cs | 2 +- .../UI/ViewModels/UserProfileViewModel.cs | 4 +-- .../UI/ViewModels/UserSaveManagerViewModel.cs | 4 +-- .../UI/ViewModels/XCITrimmerViewModel.cs | 8 ++--- .../UI/Views/Main/MainMenuBarView.axaml.cs | 4 +-- src/Spv.Generator/Module.cs | 20 ++++++------- 176 files changed, 308 insertions(+), 308 deletions(-) diff --git a/src/ARMeilleure/CodeGen/Arm64/CodeGenerator.cs b/src/ARMeilleure/CodeGen/Arm64/CodeGenerator.cs index 2df86671a..74e092104 100644 --- a/src/ARMeilleure/CodeGen/Arm64/CodeGenerator.cs +++ b/src/ARMeilleure/CodeGen/Arm64/CodeGenerator.cs @@ -1079,7 +1079,7 @@ namespace ARMeilleure.CodeGen.Arm64 private static UnwindInfo WritePrologue(CodeGenContext context) { - List pushEntries = new(); + List pushEntries = []; Operand rsp = Register(SpRegister); diff --git a/src/ARMeilleure/CodeGen/RegisterAllocators/CopyResolver.cs b/src/ARMeilleure/CodeGen/RegisterAllocators/CopyResolver.cs index af10330ba..8b135afab 100644 --- a/src/ARMeilleure/CodeGen/RegisterAllocators/CopyResolver.cs +++ b/src/ARMeilleure/CodeGen/RegisterAllocators/CopyResolver.cs @@ -31,7 +31,7 @@ namespace ARMeilleure.CodeGen.RegisterAllocators public ParallelCopy() { - _copies = new List(); + _copies = []; } public void AddCopy(Register dest, Register source, OperandType type) @@ -218,7 +218,7 @@ namespace ARMeilleure.CodeGen.RegisterAllocators public Operation[] Sequence() { - List sequence = new(); + List sequence = []; if (_spillQueue != null) { diff --git a/src/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs b/src/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs index 16feeb914..2b20ce61e 100644 --- a/src/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs +++ b/src/ARMeilleure/CodeGen/RegisterAllocators/LinearScanAllocator.cs @@ -799,8 +799,8 @@ namespace ARMeilleure.CodeGen.RegisterAllocators private void NumberLocals(ControlFlowGraph cfg, int registersCount) { - _operationNodes = new List<(IntrusiveList, Operation)>(); - _intervals = new List(); + _operationNodes = []; + _intervals = []; for (int index = 0; index < registersCount; index++) { @@ -980,7 +980,7 @@ namespace ARMeilleure.CodeGen.RegisterAllocators _blockLiveIn = blkLiveIn; - _blockEdges = new HashSet(); + _blockEdges = []; // Compute lifetime intervals. int operationPos = _operationsCount; diff --git a/src/ARMeilleure/CodeGen/X86/Assembler.cs b/src/ARMeilleure/CodeGen/X86/Assembler.cs index 96f4de049..b4d4b9c6e 100644 --- a/src/ARMeilleure/CodeGen/X86/Assembler.cs +++ b/src/ARMeilleure/CodeGen/X86/Assembler.cs @@ -74,9 +74,9 @@ namespace ARMeilleure.CodeGen.X86 { _stream = stream; _labels = new Dictionary(); - _jumps = new List(); + _jumps = []; - _relocs = relocatable ? new List() : null; + _relocs = relocatable ? [] : null; } public void MarkLabel(Operand label) diff --git a/src/ARMeilleure/CodeGen/X86/CodeGenerator.cs b/src/ARMeilleure/CodeGen/X86/CodeGenerator.cs index 9e94a077f..fa86a5d8d 100644 --- a/src/ARMeilleure/CodeGen/X86/CodeGenerator.cs +++ b/src/ARMeilleure/CodeGen/X86/CodeGenerator.cs @@ -1748,7 +1748,7 @@ namespace ARMeilleure.CodeGen.X86 private static UnwindInfo WritePrologue(CodeGenContext context) { - List pushEntries = new(); + List pushEntries = []; Operand rsp = Register(X86Register.Rsp); diff --git a/src/ARMeilleure/Common/ArenaAllocator.cs b/src/ARMeilleure/Common/ArenaAllocator.cs index ce8e33913..200f0583f 100644 --- a/src/ARMeilleure/Common/ArenaAllocator.cs +++ b/src/ARMeilleure/Common/ArenaAllocator.cs @@ -31,11 +31,11 @@ namespace ARMeilleure.Common _pageIndex = -1; _page = null; - _pages = new List(); + _pages = []; _pageSize = pageSize; _pageCount = pageCount; - _extras = new List(); + _extras = []; } public Span AllocateSpan(ulong count) where T : unmanaged diff --git a/src/ARMeilleure/Decoders/Block.cs b/src/ARMeilleure/Decoders/Block.cs index bb88170da..3ece552ec 100644 --- a/src/ARMeilleure/Decoders/Block.cs +++ b/src/ARMeilleure/Decoders/Block.cs @@ -17,7 +17,7 @@ namespace ARMeilleure.Decoders public Block() { - OpCodes = new List(); + OpCodes = []; } public Block(ulong address) : this() diff --git a/src/ARMeilleure/Decoders/Decoder.cs b/src/ARMeilleure/Decoders/Decoder.cs index 66d286928..3946e2f2e 100644 --- a/src/ARMeilleure/Decoders/Decoder.cs +++ b/src/ARMeilleure/Decoders/Decoder.cs @@ -20,7 +20,7 @@ namespace ARMeilleure.Decoders public static Block[] Decode(IMemoryManager memory, ulong address, ExecutionMode mode, bool highCq, DecoderMode dMode) { - List blocks = new(); + List blocks = []; Queue workQueue = new(); diff --git a/src/ARMeilleure/Decoders/OpCodeT16IfThen.cs b/src/ARMeilleure/Decoders/OpCodeT16IfThen.cs index ea435a79b..2aa22a431 100644 --- a/src/ARMeilleure/Decoders/OpCodeT16IfThen.cs +++ b/src/ARMeilleure/Decoders/OpCodeT16IfThen.cs @@ -12,7 +12,7 @@ namespace ARMeilleure.Decoders public OpCodeT16IfThen(InstDescriptor inst, ulong address, int opCode) : base(inst, address, opCode) { - List conds = new(); + List conds = []; int cond = (opCode >> 4) & 0xf; int mask = opCode & 0xf; diff --git a/src/ARMeilleure/Decoders/OpCodeTable.cs b/src/ARMeilleure/Decoders/OpCodeTable.cs index 20d567fe5..d5e630f9b 100644 --- a/src/ARMeilleure/Decoders/OpCodeTable.cs +++ b/src/ARMeilleure/Decoders/OpCodeTable.cs @@ -29,9 +29,9 @@ namespace ARMeilleure.Decoders } } - private static readonly List _allInstA32 = new(); - private static readonly List _allInstT32 = new(); - private static readonly List _allInstA64 = new(); + private static readonly List _allInstA32 = []; + private static readonly List _allInstT32 = []; + private static readonly List _allInstA64 = []; private static readonly InstInfo[][] _instA32FastLookup = new InstInfo[FastLookupSize][]; private static readonly InstInfo[][] _instT32FastLookup = new InstInfo[FastLookupSize][]; @@ -1330,7 +1330,7 @@ namespace ARMeilleure.Decoders for (int index = 0; index < temp.Length; index++) { - temp[index] = new List(); + temp[index] = []; } foreach (InstInfo inst in allInsts) diff --git a/src/ARMeilleure/Diagnostics/Symbols.cs b/src/ARMeilleure/Diagnostics/Symbols.cs index be74d2b5b..c2ff06e6c 100644 --- a/src/ARMeilleure/Diagnostics/Symbols.cs +++ b/src/ARMeilleure/Diagnostics/Symbols.cs @@ -29,7 +29,7 @@ namespace ARMeilleure.Diagnostics static Symbols() { _symbols = new ConcurrentDictionary(); - _rangedSymbols = new List(); + _rangedSymbols = []; } public static string Get(ulong address) diff --git a/src/ARMeilleure/IntermediateRepresentation/BasicBlock.cs b/src/ARMeilleure/IntermediateRepresentation/BasicBlock.cs index 810461d7c..c0548f4cb 100644 --- a/src/ARMeilleure/IntermediateRepresentation/BasicBlock.cs +++ b/src/ARMeilleure/IntermediateRepresentation/BasicBlock.cs @@ -27,7 +27,7 @@ namespace ARMeilleure.IntermediateRepresentation { get { - _domFrontiers ??= new HashSet(); + _domFrontiers ??= []; return _domFrontiers; } @@ -38,7 +38,7 @@ namespace ARMeilleure.IntermediateRepresentation public BasicBlock(int index) { Operations = new IntrusiveList(); - Predecessors = new List(); + Predecessors = []; Index = index; } diff --git a/src/ARMeilleure/Translation/Cache/CacheMemoryAllocator.cs b/src/ARMeilleure/Translation/Cache/CacheMemoryAllocator.cs index f36bf7a3d..9c5ca29df 100644 --- a/src/ARMeilleure/Translation/Cache/CacheMemoryAllocator.cs +++ b/src/ARMeilleure/Translation/Cache/CacheMemoryAllocator.cs @@ -23,7 +23,7 @@ namespace ARMeilleure.Translation.Cache } } - private readonly List _blocks = new(); + private readonly List _blocks = []; public CacheMemoryAllocator(int capacity) { diff --git a/src/ARMeilleure/Translation/Cache/JitCache.cs b/src/ARMeilleure/Translation/Cache/JitCache.cs index 0e23e9b0d..faccdabbe 100644 --- a/src/ARMeilleure/Translation/Cache/JitCache.cs +++ b/src/ARMeilleure/Translation/Cache/JitCache.cs @@ -26,12 +26,12 @@ namespace ARMeilleure.Translation.Cache private static List _cacheAllocators = []; - private static readonly List _cacheEntries = new(); + private static readonly List _cacheEntries = []; private static readonly Lock _lock = new(); private static bool _initialized; - private static readonly List _jitRegions = new(); + private static readonly List _jitRegions = []; private static int _activeRegionIndex = 0; [SupportedOSPlatform("windows")] diff --git a/src/ARMeilleure/Translation/IntervalTree.cs b/src/ARMeilleure/Translation/IntervalTree.cs index a5f9b5d5e..2fa431a8b 100644 --- a/src/ARMeilleure/Translation/IntervalTree.cs +++ b/src/ARMeilleure/Translation/IntervalTree.cs @@ -108,7 +108,7 @@ namespace ARMeilleure.Translation /// A list of all values sorted by Key Order public List AsList() { - List list = new(); + List list = []; AddToList(_root, list); diff --git a/src/ARMeilleure/Translation/PTC/PtcFormatter.cs b/src/ARMeilleure/Translation/PTC/PtcFormatter.cs index 60953dcd9..92b3248c6 100644 --- a/src/ARMeilleure/Translation/PTC/PtcFormatter.cs +++ b/src/ARMeilleure/Translation/PTC/PtcFormatter.cs @@ -50,7 +50,7 @@ namespace ARMeilleure.Translation.PTC [MethodImpl(MethodImplOptions.AggressiveInlining)] public static List DeserializeList(Stream stream) where T : struct { - List list = new(); + List list = []; int count = DeserializeStructure(stream); diff --git a/src/ARMeilleure/Translation/PTC/PtcProfiler.cs b/src/ARMeilleure/Translation/PTC/PtcProfiler.cs index 4962f2d1f..59165af86 100644 --- a/src/ARMeilleure/Translation/PTC/PtcProfiler.cs +++ b/src/ARMeilleure/Translation/PTC/PtcProfiler.cs @@ -140,7 +140,7 @@ namespace ARMeilleure.Translation.PTC public List GetBlacklistedFunctions() { - List funcs = new List(); + List funcs = []; foreach (var profiledFunc in ProfiledFuncs) { diff --git a/src/ARMeilleure/Translation/TranslatorQueue.cs b/src/ARMeilleure/Translation/TranslatorQueue.cs index 831522bc1..ba261eaa5 100644 --- a/src/ARMeilleure/Translation/TranslatorQueue.cs +++ b/src/ARMeilleure/Translation/TranslatorQueue.cs @@ -36,7 +36,7 @@ namespace ARMeilleure.Translation Sync = new object(); _requests = new Stack(); - _requestAddresses = new HashSet(); + _requestAddresses = []; } /// diff --git a/src/Ryujinx.Audio/Renderer/Dsp/Command/CommandList.cs b/src/Ryujinx.Audio/Renderer/Dsp/Command/CommandList.cs index 3fe106ddf..de186b2f5 100644 --- a/src/Ryujinx.Audio/Renderer/Dsp/Command/CommandList.cs +++ b/src/Ryujinx.Audio/Renderer/Dsp/Command/CommandList.cs @@ -46,7 +46,7 @@ namespace Ryujinx.Audio.Renderer.Dsp.Command SampleRate = sampleRate; BufferCount = mixBufferCount + voiceChannelCountMax; Buffers = mixBuffer; - Commands = new List(); + Commands = []; MemoryManager = memoryManager; _buffersEntryCount = Buffers.Length; diff --git a/src/Ryujinx.Common/Collections/TreeDictionary.cs b/src/Ryujinx.Common/Collections/TreeDictionary.cs index 5379d353c..18f48188a 100644 --- a/src/Ryujinx.Common/Collections/TreeDictionary.cs +++ b/src/Ryujinx.Common/Collections/TreeDictionary.cs @@ -139,7 +139,7 @@ namespace Ryujinx.Common.Collections /// List to add the tree pairs into public List> AsLevelOrderList() { - List> list = new(); + List> list = []; Queue> nodes = new(); @@ -168,7 +168,7 @@ namespace Ryujinx.Common.Collections /// A list of all KeyValuePairs sorted by Key Order public List> AsList() { - List> list = new(); + List> list = []; AddToList(Root, list); diff --git a/src/Ryujinx.Common/Configuration/ModMetadata.cs b/src/Ryujinx.Common/Configuration/ModMetadata.cs index 174320d0a..6bc9482ad 100644 --- a/src/Ryujinx.Common/Configuration/ModMetadata.cs +++ b/src/Ryujinx.Common/Configuration/ModMetadata.cs @@ -8,7 +8,7 @@ namespace Ryujinx.Common.Configuration public ModMetadata() { - Mods = new List(); + Mods = []; } } } diff --git a/src/Ryujinx.Common/Logging/Logger.cs b/src/Ryujinx.Common/Logging/Logger.cs index db46739ac..3b917fc1f 100644 --- a/src/Ryujinx.Common/Logging/Logger.cs +++ b/src/Ryujinx.Common/Logging/Logger.cs @@ -131,7 +131,7 @@ namespace Ryujinx.Common.Logging _enabledClasses[index] = true; } - _logTargets = new List(); + _logTargets = []; _time = Stopwatch.StartNew(); diff --git a/src/Ryujinx.Common/PreciseSleep/NanosleepPool.cs b/src/Ryujinx.Common/PreciseSleep/NanosleepPool.cs index 45b8e95fa..3569dd968 100644 --- a/src/Ryujinx.Common/PreciseSleep/NanosleepPool.cs +++ b/src/Ryujinx.Common/PreciseSleep/NanosleepPool.cs @@ -125,8 +125,8 @@ namespace Ryujinx.Common.PreciseSleep } private readonly Lock _lock = new(); - private readonly List _threads = new(); - private readonly List _active = new(); + private readonly List _threads = []; + private readonly List _active = []; private readonly Stack _free = new(); private readonly AutoResetEvent _signalTarget; diff --git a/src/Ryujinx.Common/PreciseSleep/WindowsGranularTimer.cs b/src/Ryujinx.Common/PreciseSleep/WindowsGranularTimer.cs index cef4dc927..143c9c8d3 100644 --- a/src/Ryujinx.Common/PreciseSleep/WindowsGranularTimer.cs +++ b/src/Ryujinx.Common/PreciseSleep/WindowsGranularTimer.cs @@ -51,7 +51,7 @@ namespace Ryujinx.Common.SystemInterop private long _lastId; private readonly Lock _lock = new(); - private readonly List _waitingObjects = new(); + private readonly List _waitingObjects = []; private WindowsGranularTimer() { diff --git a/src/Ryujinx.Cpu/AddressTable.cs b/src/Ryujinx.Cpu/AddressTable.cs index 038a2009c..f8c27645c 100644 --- a/src/Ryujinx.Cpu/AddressTable.cs +++ b/src/Ryujinx.Cpu/AddressTable.cs @@ -164,7 +164,7 @@ namespace ARMeilleure.Common _fillBottomLevel = new SparseMemoryBlock(bottomLevelSize, null, _sparseFill); _fillBottomLevelPtr = (TEntry*)_fillBottomLevel.Block.Pointer; - _sparseReserved = new List(); + _sparseReserved = []; _sparseLock = new ReaderWriterLockSlim(); _sparseBlockSize = bottomLevelSize; diff --git a/src/Ryujinx.Cpu/Jit/HostTracked/AddressSpacePartitioned.cs b/src/Ryujinx.Cpu/Jit/HostTracked/AddressSpacePartitioned.cs index 2cf2c248b..e811ec821 100644 --- a/src/Ryujinx.Cpu/Jit/HostTracked/AddressSpacePartitioned.cs +++ b/src/Ryujinx.Cpu/Jit/HostTracked/AddressSpacePartitioned.cs @@ -21,7 +21,7 @@ namespace Ryujinx.Cpu.Jit.HostTracked public AddressSpacePartitioned(MemoryTracking tracking, MemoryBlock backingMemory, NativePageTable nativePageTable, bool useProtectionMirrors) { _backingMemory = backingMemory; - _partitions = new(); + _partitions = []; _asAllocator = new(tracking, nativePageTable.Read, _partitions); _updatePtCallback = nativePageTable.Update; _useProtectionMirrors = useProtectionMirrors; diff --git a/src/Ryujinx.Cpu/LightningJit/Arm32/CodeGenContext.cs b/src/Ryujinx.Cpu/LightningJit/Arm32/CodeGenContext.cs index f55e2bb99..d0490a8a6 100644 --- a/src/Ryujinx.Cpu/LightningJit/Arm32/CodeGenContext.cs +++ b/src/Ryujinx.Cpu/LightningJit/Arm32/CodeGenContext.cs @@ -36,7 +36,7 @@ namespace Ryujinx.Cpu.LightningJit.Arm32 RegisterAllocator = registerAllocator; MemoryManagerType = mmType; _itConditions = new ArmCondition[4]; - _pendingBranches = new(); + _pendingBranches = []; IsThumb = isThumb; } diff --git a/src/Ryujinx.Cpu/LightningJit/Arm32/Decoder.cs b/src/Ryujinx.Cpu/LightningJit/Arm32/Decoder.cs index 8a2b389ad..1add34f89 100644 --- a/src/Ryujinx.Cpu/LightningJit/Arm32/Decoder.cs +++ b/src/Ryujinx.Cpu/LightningJit/Arm32/Decoder.cs @@ -10,8 +10,8 @@ namespace Ryujinx.Cpu.LightningJit.Arm32 { public static MultiBlock DecodeMulti(CpuPreset cpuPreset, IMemoryManager memoryManager, ulong address, bool isThumb) { - List blocks = new(); - List branchTargets = new(); + List blocks = []; + List branchTargets = []; while (true) { @@ -202,7 +202,7 @@ namespace Ryujinx.Cpu.LightningJit.Arm32 { ulong startAddress = address; - List insts = new(); + List insts = []; uint encoding; InstMeta meta; diff --git a/src/Ryujinx.Cpu/LightningJit/Arm64/Block.cs b/src/Ryujinx.Cpu/LightningJit/Arm64/Block.cs index 188630a1c..405126357 100644 --- a/src/Ryujinx.Cpu/LightningJit/Arm64/Block.cs +++ b/src/Ryujinx.Cpu/LightningJit/Arm64/Block.cs @@ -25,8 +25,8 @@ namespace Ryujinx.Cpu.LightningJit.Arm64 { Debug.Assert((int)((endAddress - address) / 4) == instructions.Count); - _predecessors = new(); - _successors = new(); + _predecessors = []; + _successors = []; Address = address; EndAddress = endAddress; Instructions = instructions; diff --git a/src/Ryujinx.Cpu/LightningJit/Arm64/MultiBlock.cs b/src/Ryujinx.Cpu/LightningJit/Arm64/MultiBlock.cs index 8ac65059a..42fd24ec9 100644 --- a/src/Ryujinx.Cpu/LightningJit/Arm64/MultiBlock.cs +++ b/src/Ryujinx.Cpu/LightningJit/Arm64/MultiBlock.cs @@ -36,8 +36,8 @@ namespace Ryujinx.Cpu.LightningJit.Arm64 { Console.WriteLine($"bb {block.Index}"); - List predList = new(); - List succList = new(); + List predList = []; + List succList = []; for (int index = 0; index < block.PredecessorsCount; index++) { diff --git a/src/Ryujinx.Cpu/LightningJit/Arm64/Target/Arm64/Compiler.cs b/src/Ryujinx.Cpu/LightningJit/Arm64/Target/Arm64/Compiler.cs index 7a6d761e8..415859ce0 100644 --- a/src/Ryujinx.Cpu/LightningJit/Arm64/Target/Arm64/Compiler.cs +++ b/src/Ryujinx.Cpu/LightningJit/Arm64/Target/Arm64/Compiler.cs @@ -309,7 +309,7 @@ namespace Ryujinx.Cpu.LightningJit.Arm64.Target.Arm64 MultiBlock multiBlock = Decoder.DecodeMulti(cpuPreset, memoryManager, address); Dictionary targets = new(); - List pendingBranches = new(); + List pendingBranches = []; uint gprUseMask = multiBlock.GlobalUseMask.GprMask; uint fpSimdUseMask = multiBlock.GlobalUseMask.FpSimdMask; diff --git a/src/Ryujinx.Cpu/LightningJit/Arm64/Target/Arm64/Decoder.cs b/src/Ryujinx.Cpu/LightningJit/Arm64/Target/Arm64/Decoder.cs index d5e1eb19c..33d319668 100644 --- a/src/Ryujinx.Cpu/LightningJit/Arm64/Target/Arm64/Decoder.cs +++ b/src/Ryujinx.Cpu/LightningJit/Arm64/Target/Arm64/Decoder.cs @@ -15,8 +15,8 @@ namespace Ryujinx.Cpu.LightningJit.Arm64.Target.Arm64 public static MultiBlock DecodeMulti(CpuPreset cpuPreset, IMemoryManager memoryManager, ulong address) { - List blocks = new(); - List branchTargets = new(); + List blocks = []; + List branchTargets = []; RegisterMask useMask = RegisterMask.Zero; @@ -238,7 +238,7 @@ namespace Ryujinx.Cpu.LightningJit.Arm64.Target.Arm64 { ulong startAddress = address; - List insts = new(); + List insts = []; uint gprUseMask = useMask.GprMask; uint fpSimdUseMask = useMask.FpSimdMask; diff --git a/src/Ryujinx.Cpu/LightningJit/Cache/CacheMemoryAllocator.cs b/src/Ryujinx.Cpu/LightningJit/Cache/CacheMemoryAllocator.cs index 8ba3a6dcd..05c889922 100644 --- a/src/Ryujinx.Cpu/LightningJit/Cache/CacheMemoryAllocator.cs +++ b/src/Ryujinx.Cpu/LightningJit/Cache/CacheMemoryAllocator.cs @@ -24,7 +24,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache } } - private readonly List _blocks = new(); + private readonly List _blocks = []; public CacheMemoryAllocator(int capacity) { diff --git a/src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs b/src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs index f1db7c6a1..26bb50bef 100644 --- a/src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs +++ b/src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs @@ -23,11 +23,11 @@ namespace Ryujinx.Cpu.LightningJit.Cache private static CacheMemoryAllocator _cacheAllocator; - private static readonly List _cacheEntries = new(); + private static readonly List _cacheEntries = []; private static readonly Lock _lock = new(); private static bool _initialized; - private static readonly List _jitRegions = new(); + private static readonly List _jitRegions = []; private static int _activeRegionIndex = 0; [SupportedOSPlatform("windows")] diff --git a/src/Ryujinx.Cpu/LightningJit/Cache/NoWxCache.cs b/src/Ryujinx.Cpu/LightningJit/Cache/NoWxCache.cs index 40ab99b49..d2541ac19 100644 --- a/src/Ryujinx.Cpu/LightningJit/Cache/NoWxCache.cs +++ b/src/Ryujinx.Cpu/LightningJit/Cache/NoWxCache.cs @@ -231,7 +231,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache _sharedCache.Pointer, SharedCacheSize); - List<(ulong, ThreadLocalCacheEntry)> toDelete = new(); + List<(ulong, ThreadLocalCacheEntry)> toDelete = []; foreach ((ulong address, ThreadLocalCacheEntry entry) in _threadLocalCache) { diff --git a/src/Ryujinx.Cpu/LightningJit/Cache/PageAlignedRangeList.cs b/src/Ryujinx.Cpu/LightningJit/Cache/PageAlignedRangeList.cs index b6b386714..dd53dcbf7 100644 --- a/src/Ryujinx.Cpu/LightningJit/Cache/PageAlignedRangeList.cs +++ b/src/Ryujinx.Cpu/LightningJit/Cache/PageAlignedRangeList.cs @@ -35,8 +35,8 @@ namespace Ryujinx.Cpu.LightningJit.Cache { _alignedRangeAction = alignedRangeAction; _alignedFunctionAction = alignedFunctionAction; - _pendingFunctions = new(); - _ranges = new(); + _pendingFunctions = []; + _ranges = []; } public bool Has(ulong address) diff --git a/src/Ryujinx.Cpu/LightningJit/CodeGen/Arm64/Assembler.cs b/src/Ryujinx.Cpu/LightningJit/CodeGen/Arm64/Assembler.cs index 28539707f..53f15697d 100644 --- a/src/Ryujinx.Cpu/LightningJit/CodeGen/Arm64/Assembler.cs +++ b/src/Ryujinx.Cpu/LightningJit/CodeGen/Arm64/Assembler.cs @@ -26,7 +26,7 @@ namespace Ryujinx.Cpu.LightningJit.CodeGen.Arm64 public Assembler(CodeWriter writer) { _code = writer.GetList(); - _labels = new List(); + _labels = []; } public readonly Operand CreateLabel() diff --git a/src/Ryujinx.Cpu/LightningJit/CodeGen/Arm64/StackWalker.cs b/src/Ryujinx.Cpu/LightningJit/CodeGen/Arm64/StackWalker.cs index 3b01e674b..8449c9963 100644 --- a/src/Ryujinx.Cpu/LightningJit/CodeGen/Arm64/StackWalker.cs +++ b/src/Ryujinx.Cpu/LightningJit/CodeGen/Arm64/StackWalker.cs @@ -8,7 +8,7 @@ namespace Ryujinx.Cpu.LightningJit.CodeGen.Arm64 { public IEnumerable GetCallStack(IntPtr framePointer, IntPtr codeRegionStart, int codeRegionSize, IntPtr codeRegion2Start, int codeRegion2Size) { - List functionPointers = new(); + List functionPointers = []; while (true) { diff --git a/src/Ryujinx.Cpu/LightningJit/CodeGen/Arm64/TailMerger.cs b/src/Ryujinx.Cpu/LightningJit/CodeGen/Arm64/TailMerger.cs index e042af126..18204977e 100644 --- a/src/Ryujinx.Cpu/LightningJit/CodeGen/Arm64/TailMerger.cs +++ b/src/Ryujinx.Cpu/LightningJit/CodeGen/Arm64/TailMerger.cs @@ -16,7 +16,7 @@ namespace Ryujinx.Cpu.LightningJit.CodeGen.Arm64 public TailMerger() { - _branchPointers = new(); + _branchPointers = []; } public void AddConditionalReturn(CodeWriter writer, in Assembler asm, ArmCondition returnCondition) diff --git a/src/Ryujinx.Cpu/LightningJit/CodeWriter.cs b/src/Ryujinx.Cpu/LightningJit/CodeWriter.cs index ac4b22ff1..b2927908a 100644 --- a/src/Ryujinx.Cpu/LightningJit/CodeWriter.cs +++ b/src/Ryujinx.Cpu/LightningJit/CodeWriter.cs @@ -12,7 +12,7 @@ namespace Ryujinx.Cpu.LightningJit public CodeWriter() { - _instructions = new(); + _instructions = []; } public void WriteInstruction(uint instruction) diff --git a/src/Ryujinx.Cpu/LightningJit/Table/InstTableLevel.cs b/src/Ryujinx.Cpu/LightningJit/Table/InstTableLevel.cs index 6567efeef..cdad9a9fe 100644 --- a/src/Ryujinx.Cpu/LightningJit/Table/InstTableLevel.cs +++ b/src/Ryujinx.Cpu/LightningJit/Table/InstTableLevel.cs @@ -34,7 +34,7 @@ namespace Ryujinx.Cpu.LightningJit.Table { int splitIndex = (int)((insts[index].Encoding >> _shift) & _mask); - (splitList[splitIndex] ??= new()).Add(insts[index]); + (splitList[splitIndex] ??= []).Add(insts[index]); } for (int index = 0; index < count; index++) diff --git a/src/Ryujinx.Cpu/LightningJit/TranslatorStubs.cs b/src/Ryujinx.Cpu/LightningJit/TranslatorStubs.cs index d0e874e13..33919f20c 100644 --- a/src/Ryujinx.Cpu/LightningJit/TranslatorStubs.cs +++ b/src/Ryujinx.Cpu/LightningJit/TranslatorStubs.cs @@ -140,7 +140,7 @@ namespace Ryujinx.Cpu.LightningJit /// Generated private IntPtr GenerateDispatchStub() { - List branchToFallbackOffsets = new(); + List branchToFallbackOffsets = []; CodeWriter writer = new(); diff --git a/src/Ryujinx.Graphics.GAL/Multithreading/BufferMap.cs b/src/Ryujinx.Graphics.GAL/Multithreading/BufferMap.cs index e8eec123a..48bec3633 100644 --- a/src/Ryujinx.Graphics.GAL/Multithreading/BufferMap.cs +++ b/src/Ryujinx.Graphics.GAL/Multithreading/BufferMap.cs @@ -16,7 +16,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading private ulong _bufferHandle = 0; private readonly Dictionary _bufferMap = new(); - private readonly HashSet _inFlight = new(); + private readonly HashSet _inFlight = []; private readonly AutoResetEvent _inFlightChanged = new(false); internal BufferHandle CreateBufferHandle() diff --git a/src/Ryujinx.Graphics.GAL/Multithreading/Resources/ProgramQueue.cs b/src/Ryujinx.Graphics.GAL/Multithreading/Resources/ProgramQueue.cs index cda3518c7..902527b5b 100644 --- a/src/Ryujinx.Graphics.GAL/Multithreading/Resources/ProgramQueue.cs +++ b/src/Ryujinx.Graphics.GAL/Multithreading/Resources/ProgramQueue.cs @@ -22,7 +22,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading.Resources _renderer = renderer; _toCompile = new Queue(); - _inProgress = new List(); + _inProgress = []; } public void Add(IProgramRequest request) diff --git a/src/Ryujinx.Graphics.GAL/Multithreading/SyncMap.cs b/src/Ryujinx.Graphics.GAL/Multithreading/SyncMap.cs index ecdff4922..d777abdb9 100644 --- a/src/Ryujinx.Graphics.GAL/Multithreading/SyncMap.cs +++ b/src/Ryujinx.Graphics.GAL/Multithreading/SyncMap.cs @@ -6,7 +6,7 @@ namespace Ryujinx.Graphics.GAL.Multithreading { class SyncMap : IDisposable { - private readonly HashSet _inFlight = new(); + private readonly HashSet _inFlight = []; private readonly AutoResetEvent _inFlightChanged = new(false); internal void CreateSyncHandle(ulong id) diff --git a/src/Ryujinx.Graphics.Gpu/Engine/Threed/Blender/UcodeAssembler.cs b/src/Ryujinx.Graphics.Gpu/Engine/Threed/Blender/UcodeAssembler.cs index 8e0209062..138a83440 100644 --- a/src/Ryujinx.Graphics.Gpu/Engine/Threed/Blender/UcodeAssembler.cs +++ b/src/Ryujinx.Graphics.Gpu/Engine/Threed/Blender/UcodeAssembler.cs @@ -274,7 +274,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed.Blender private void Assemble(CC cc, Instruction inst, Dest dest, OpAC srcA, OpBD srcB, OpAC srcC, OpBD srcD) { - (_code ??= new List()).Add(new UcodeOp(cc, inst, _constantIndex, dest, srcA, srcB, srcC, srcD).Word); + (_code ??= []).Add(new UcodeOp(cc, inst, _constantIndex, dest, srcA, srcB, srcC, srcD).Word); } public void SetConstant(int index, float r, float g, float b) diff --git a/src/Ryujinx.Graphics.Gpu/GpuContext.cs b/src/Ryujinx.Graphics.Gpu/GpuContext.cs index fb529e914..b759db5b5 100644 --- a/src/Ryujinx.Graphics.Gpu/GpuContext.cs +++ b/src/Ryujinx.Graphics.Gpu/GpuContext.cs @@ -126,9 +126,9 @@ namespace Ryujinx.Graphics.Gpu HostInitalized = new ManualResetEvent(false); _gpuReadyEvent = new ManualResetEvent(false); - SyncActions = new List(); - SyncpointActions = new List(); - BufferMigrations = new List(); + SyncActions = []; + SyncpointActions = []; + BufferMigrations = []; DeferredActions = new Queue(); diff --git a/src/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs b/src/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs index cafd94b2c..d0bf7df8f 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/AutoDeleteCache.cs @@ -118,10 +118,10 @@ namespace Ryujinx.Graphics.Gpu.Image /// public AutoDeleteCache() { - _textures = new LinkedList(); + _textures = []; - _shortCacheBuilder = new HashSet(); - _shortCache = new HashSet(); + _shortCacheBuilder = []; + _shortCache = []; _shortCacheLookup = new Dictionary(); } diff --git a/src/Ryujinx.Graphics.Gpu/Image/PoolCache.cs b/src/Ryujinx.Graphics.Gpu/Image/PoolCache.cs index 50872ab63..b9aa37fed 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/PoolCache.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/PoolCache.cs @@ -45,7 +45,7 @@ namespace Ryujinx.Graphics.Gpu.Image public PoolCache(GpuContext context) { _context = context; - _pools = new LinkedList(); + _pools = []; } /// diff --git a/src/Ryujinx.Graphics.Gpu/Image/Texture.cs b/src/Ryujinx.Graphics.Gpu/Image/Texture.cs index 7ee2e5cf0..8ef0a1b91 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/Texture.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/Texture.cs @@ -260,8 +260,8 @@ namespace Ryujinx.Graphics.Gpu.Image _viewStorage = this; - _views = new List(); - _poolOwners = new List(); + _views = []; + _poolOwners = []; } /// diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs index 72bac75e5..5f23b5b1a 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/TextureBindingsArrayCache.cs @@ -549,7 +549,7 @@ namespace Ryujinx.Graphics.Gpu.Image _channel = channel; _cacheFromBuffer = new Dictionary(); _cacheFromPool = new Dictionary(); - _lruCache = new LinkedList(); + _lruCache = []; } /// @@ -1116,7 +1116,7 @@ namespace Ryujinx.Graphics.Gpu.Image { if (key.MatchesPool(pool)) { - (keysToRemove ??= new()).Add(key); + (keysToRemove ??= []).Add(key); if (key.IsImage) { diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureCache.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureCache.cs index ff7f11142..b032d24cc 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/TextureCache.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/TextureCache.cs @@ -58,15 +58,15 @@ namespace Ryujinx.Graphics.Gpu.Image _context = context; _physicalMemory = physicalMemory; - _textures = new MultiRangeList(); - _partiallyMappedTextures = new HashSet(); + _textures = []; + _partiallyMappedTextures = []; _texturesLock = new ReaderWriterLockSlim(); _textureOverlaps = new Texture[OverlapsBufferInitialCapacity]; _overlapInfo = new OverlapInfo[OverlapsBufferInitialCapacity]; - _cache = new AutoDeleteCache(); + _cache = []; } /// @@ -892,7 +892,7 @@ namespace Ryujinx.Graphics.Gpu.Image // otherwise we only need the data that is copied from the existing texture, without loading the CPU data. bool updateNewTexture = texture.Width > overlap.Width || texture.Height > overlap.Height; - texture.InitializeGroup(true, true, new List()); + texture.InitializeGroup(true, true, []); texture.InitializeData(false, updateNewTexture); overlap.SynchronizeMemory(); diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs index 860922d59..fe22b9e63 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs @@ -134,8 +134,8 @@ namespace Ryujinx.Graphics.Gpu.Image Offset = offset; Size = (int)size; - Overlaps = new List(); - Dependencies = new List(); + Overlaps = []; + Dependencies = []; BaseSlice = baseSlice; SliceCount = sliceCount; diff --git a/src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs b/src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs index 3bf122412..c66cbe92b 100644 --- a/src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs +++ b/src/Ryujinx.Graphics.Gpu/Image/TexturePool.cs @@ -97,7 +97,7 @@ namespace Ryujinx.Graphics.Gpu.Image /// public TextureAliasList() { - _aliases = new List(); + _aliases = []; } /// diff --git a/src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs b/src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs index e060e0b4f..a9444daa4 100644 --- a/src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs +++ b/src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs @@ -799,7 +799,7 @@ namespace Ryujinx.Graphics.Gpu.Memory try { - (_virtualDependencies ??= new()).Add(virtualBuffer); + (_virtualDependencies ??= []).Add(virtualBuffer); } finally { diff --git a/src/Ryujinx.Graphics.Gpu/Memory/BufferCache.cs b/src/Ryujinx.Graphics.Gpu/Memory/BufferCache.cs index 66d2cdb62..d19ba4779 100644 --- a/src/Ryujinx.Graphics.Gpu/Memory/BufferCache.cs +++ b/src/Ryujinx.Graphics.Gpu/Memory/BufferCache.cs @@ -61,8 +61,8 @@ namespace Ryujinx.Graphics.Gpu.Memory _context = context; _physicalMemory = physicalMemory; - _buffers = new RangeList(); - _multiRangeBuffers = new MultiRangeList(); + _buffers = []; + _multiRangeBuffers = []; _bufferOverlaps = new Buffer[OverlapsBufferInitialCapacity]; @@ -395,7 +395,7 @@ namespace Ryujinx.Graphics.Gpu.Memory ulong dstOffset = 0; - HashSet physicalBuffers = new(); + HashSet 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); } } diff --git a/src/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs b/src/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs index 409867e09..88b240e6b 100644 --- a/src/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs +++ b/src/Ryujinx.Graphics.Gpu/Memory/BufferManager.cs @@ -141,9 +141,9 @@ namespace Ryujinx.Graphics.Gpu.Memory _gpUniformBuffers[index] = new BuffersPerStage(Constants.TotalGpUniformBuffers); } - _bufferTextures = new List(); - _bufferTextureArrays = new List>(); - _bufferImageArrays = new List>(); + _bufferTextures = []; + _bufferTextureArrays = []; + _bufferImageArrays = []; _ranges = new BufferAssignment[Constants.TotalGpUniformBuffers * Constants.ShaderStages]; } diff --git a/src/Ryujinx.Graphics.Gpu/Memory/CounterCache.cs b/src/Ryujinx.Graphics.Gpu/Memory/CounterCache.cs index 24966df41..2d67c2c28 100644 --- a/src/Ryujinx.Graphics.Gpu/Memory/CounterCache.cs +++ b/src/Ryujinx.Graphics.Gpu/Memory/CounterCache.cs @@ -27,7 +27,7 @@ namespace Ryujinx.Graphics.Gpu.Memory /// public CounterCache() { - _items = new List(); + _items = []; } /// diff --git a/src/Ryujinx.Graphics.Gpu/Memory/MultiRangeBuffer.cs b/src/Ryujinx.Graphics.Gpu/Memory/MultiRangeBuffer.cs index d92b0836e..86de37876 100644 --- a/src/Ryujinx.Graphics.Gpu/Memory/MultiRangeBuffer.cs +++ b/src/Ryujinx.Graphics.Gpu/Memory/MultiRangeBuffer.cs @@ -128,7 +128,7 @@ namespace Ryujinx.Graphics.Gpu.Memory /// Size of the range in bytes 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); } diff --git a/src/Ryujinx.Graphics.Gpu/Memory/UnmapEventArgs.cs b/src/Ryujinx.Graphics.Gpu/Memory/UnmapEventArgs.cs index 83fb1fcee..3e2782da6 100644 --- a/src/Ryujinx.Graphics.Gpu/Memory/UnmapEventArgs.cs +++ b/src/Ryujinx.Graphics.Gpu/Memory/UnmapEventArgs.cs @@ -17,7 +17,7 @@ namespace Ryujinx.Graphics.Gpu.Memory public void AddRemapAction(Action action) { - RemapActions ??= new List(); + RemapActions ??= []; RemapActions.Add(action); } } diff --git a/src/Ryujinx.Graphics.Gpu/Memory/VirtualRangeCache.cs b/src/Ryujinx.Graphics.Gpu/Memory/VirtualRangeCache.cs index 964507a21..ac25b3e5d 100644 --- a/src/Ryujinx.Graphics.Gpu/Memory/VirtualRangeCache.cs +++ b/src/Ryujinx.Graphics.Gpu/Memory/VirtualRangeCache.cs @@ -74,7 +74,7 @@ namespace Ryujinx.Graphics.Gpu.Memory public VirtualRangeCache(MemoryManager memoryManager) { _memoryManager = memoryManager; - _virtualRanges = new RangeList(); + _virtualRanges = []; _virtualRangeOverlaps = new VirtualRange[BufferCache.OverlapsBufferInitialCapacity]; _deferredUnmaps = new ConcurrentQueue(); } diff --git a/src/Ryujinx.Graphics.Gpu/Shader/ComputeShaderCacheHashTable.cs b/src/Ryujinx.Graphics.Gpu/Shader/ComputeShaderCacheHashTable.cs index 0119a6a33..1ec47ca6e 100644 --- a/src/Ryujinx.Graphics.Gpu/Shader/ComputeShaderCacheHashTable.cs +++ b/src/Ryujinx.Graphics.Gpu/Shader/ComputeShaderCacheHashTable.cs @@ -17,7 +17,7 @@ namespace Ryujinx.Graphics.Gpu.Shader public ComputeShaderCacheHashTable() { _cache = new PartitionedHashTable(); - _shaderPrograms = new List(); + _shaderPrograms = []; } /// @@ -26,7 +26,7 @@ namespace Ryujinx.Graphics.Gpu.Shader /// Program to be added public void Add(CachedShaderProgram program) { - var specList = _cache.GetOrAdd(program.Shaders[0].Code, new ShaderSpecializationList()); + var specList = _cache.GetOrAdd(program.Shaders[0].Code, []); specList.Add(program); _shaderPrograms.Add(program); } diff --git a/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheGuestStorage.cs b/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheGuestStorage.cs index 08cd3bb02..04c269f17 100644 --- a/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheGuestStorage.cs +++ b/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/DiskCacheGuestStorage.cs @@ -429,7 +429,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache { if (!_toc.TryGetValue(hash, out var list)) { - _toc.Add(hash, list = new List()); + _toc.Add(hash, list = []); } list.Add(new TocMemoryEntry(dataOffset, codeSize, cb1DataSize, index)); diff --git a/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/ShaderBinarySerializer.cs b/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/ShaderBinarySerializer.cs index a18b5780e..8e8bf8e5e 100644 --- a/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/ShaderBinarySerializer.cs +++ b/src/Ryujinx.Graphics.Gpu/Shader/DiskCache/ShaderBinarySerializer.cs @@ -31,7 +31,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache using MemoryStream input = new(code); using BinaryReader reader = new(input); - List output = new(); + List output = []; int count = reader.ReadInt32(); diff --git a/src/Ryujinx.Graphics.Gpu/Shader/HashTable/PartitionedHashTable.cs b/src/Ryujinx.Graphics.Gpu/Shader/HashTable/PartitionedHashTable.cs index b4c18058c..b8d782554 100644 --- a/src/Ryujinx.Graphics.Gpu/Shader/HashTable/PartitionedHashTable.cs +++ b/src/Ryujinx.Graphics.Gpu/Shader/HashTable/PartitionedHashTable.cs @@ -104,7 +104,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.HashTable /// public PartitionedHashTable() { - _sizeTable = new List(); + _sizeTable = []; } /// diff --git a/src/Ryujinx.Graphics.Gpu/Shader/ShaderCacheHashTable.cs b/src/Ryujinx.Graphics.Gpu/Shader/ShaderCacheHashTable.cs index e65a1dec9..3843f7581 100644 --- a/src/Ryujinx.Graphics.Gpu/Shader/ShaderCacheHashTable.cs +++ b/src/Ryujinx.Graphics.Gpu/Shader/ShaderCacheHashTable.cs @@ -192,7 +192,7 @@ namespace Ryujinx.Graphics.Gpu.Shader if (!_shaderPrograms.TryGetValue(idTable, out ShaderSpecializationList specList)) { - specList = new ShaderSpecializationList(); + specList = []; _shaderPrograms.Add(idTable, specList); } diff --git a/src/Ryujinx.Graphics.Gpu/Shader/ShaderInfoBuilder.cs b/src/Ryujinx.Graphics.Gpu/Shader/ShaderInfoBuilder.cs index 49823562f..ae8224455 100644 --- a/src/Ryujinx.Graphics.Gpu/Shader/ShaderInfoBuilder.cs +++ b/src/Ryujinx.Graphics.Gpu/Shader/ShaderInfoBuilder.cs @@ -60,8 +60,8 @@ namespace Ryujinx.Graphics.Gpu.Shader for (int index = 0; index < totalSets; index++) { - _resourceDescriptors[index] = new(); - _resourceUsages[index] = new(); + _resourceDescriptors[index] = []; + _resourceUsages[index] = []; } AddDescriptor(SupportBufferStages, ResourceType.UniformBuffer, uniformSetIndex, 0, 1); @@ -280,7 +280,7 @@ namespace Ryujinx.Graphics.Gpu.Shader for (int index = oldLength; index <= setIndex; index++) { - _resourceDescriptors[index] = new(); + _resourceDescriptors[index] = []; } } @@ -301,7 +301,7 @@ namespace Ryujinx.Graphics.Gpu.Shader for (int index = oldLength; index <= setIndex; index++) { - _resourceUsages[index] = new(); + _resourceUsages[index] = []; } } diff --git a/src/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationList.cs b/src/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationList.cs index 3c2f0b9be..1d2b873de 100644 --- a/src/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationList.cs +++ b/src/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationList.cs @@ -8,7 +8,7 @@ namespace Ryujinx.Graphics.Gpu.Shader /// class ShaderSpecializationList : IEnumerable { - private readonly List _entries = new(); + private readonly List _entries = []; /// /// Adds a program to the list. diff --git a/src/Ryujinx.Graphics.Gpu/Synchronization/Syncpoint.cs b/src/Ryujinx.Graphics.Gpu/Synchronization/Syncpoint.cs index a1626c853..b2e0abf21 100644 --- a/src/Ryujinx.Graphics.Gpu/Synchronization/Syncpoint.cs +++ b/src/Ryujinx.Graphics.Gpu/Synchronization/Syncpoint.cs @@ -24,7 +24,7 @@ namespace Ryujinx.Graphics.Gpu.Synchronization public Syncpoint(uint id) { Id = id; - _waiters = new List(); + _waiters = []; } /// @@ -92,7 +92,7 @@ namespace Ryujinx.Graphics.Gpu.Synchronization } else { - expiredList ??= new List(); + expiredList ??= []; expiredList.Add(item); } diff --git a/src/Ryujinx.Graphics.Host1x/SyncptIncrManager.cs b/src/Ryujinx.Graphics.Host1x/SyncptIncrManager.cs index a5ee1198c..ee8a4a739 100644 --- a/src/Ryujinx.Graphics.Host1x/SyncptIncrManager.cs +++ b/src/Ryujinx.Graphics.Host1x/SyncptIncrManager.cs @@ -23,7 +23,7 @@ namespace Ryujinx.Graphics.Host1x } } - private readonly List _incrs = new(); + private readonly List _incrs = []; private uint _currentId; diff --git a/src/Ryujinx.Graphics.OpenGL/Image/IntermmediatePool.cs b/src/Ryujinx.Graphics.OpenGL/Image/IntermmediatePool.cs index 64ee73fbe..1bcc13ab4 100644 --- a/src/Ryujinx.Graphics.OpenGL/Image/IntermmediatePool.cs +++ b/src/Ryujinx.Graphics.OpenGL/Image/IntermmediatePool.cs @@ -12,7 +12,7 @@ namespace Ryujinx.Graphics.OpenGL.Image public IntermediatePool(OpenGLRenderer renderer) { _renderer = renderer; - _entries = new List(); + _entries = []; } public TextureView GetOrCreateWithAtLeast( diff --git a/src/Ryujinx.Graphics.OpenGL/ResourcePool.cs b/src/Ryujinx.Graphics.OpenGL/ResourcePool.cs index c8ff30a07..352728813 100644 --- a/src/Ryujinx.Graphics.OpenGL/ResourcePool.cs +++ b/src/Ryujinx.Graphics.OpenGL/ResourcePool.cs @@ -34,7 +34,7 @@ namespace Ryujinx.Graphics.OpenGL { if (!_textures.TryGetValue(view.Info, out List list)) { - list = new List(); + list = []; _textures.Add(view.Info, list); } diff --git a/src/Ryujinx.Graphics.OpenGL/Sync.cs b/src/Ryujinx.Graphics.OpenGL/Sync.cs index eba1638a3..dd9a9b3ec 100644 --- a/src/Ryujinx.Graphics.OpenGL/Sync.cs +++ b/src/Ryujinx.Graphics.OpenGL/Sync.cs @@ -17,7 +17,7 @@ namespace Ryujinx.Graphics.OpenGL private ulong _firstHandle = 0; private static ClientWaitSyncFlags SyncFlags => HwCapabilities.RequiresSyncFlush ? ClientWaitSyncFlags.None : ClientWaitSyncFlags.SyncFlushCommandsBit; - private readonly List _handles = new(); + private readonly List _handles = []; public void Create(ulong id) { diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/CodeGenContext.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/CodeGenContext.cs index 104e427ca..4faba77f3 100644 --- a/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/CodeGenContext.cs +++ b/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/CodeGenContext.cs @@ -49,7 +49,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv private class BlockState { private int _entryCount; - private readonly List _labels = new(); + private readonly List _labels = []; public Instruction GetNextLabel(CodeGenContext context) { diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/Declarations.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/Declarations.cs index 55d35bf0d..19041981a 100644 --- a/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/Declarations.cs +++ b/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/Declarations.cs @@ -81,7 +81,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv private static void DeclareBuffers(CodeGenContext context, IEnumerable buffers, bool isBuffer) { - HashSet decoratedTypes = new(); + HashSet decoratedTypes = []; foreach (BufferDefinition buffer in buffers) { diff --git a/src/Ryujinx.Graphics.Shader/Decoders/Block.cs b/src/Ryujinx.Graphics.Shader/Decoders/Block.cs index 1a694898b..9264d15b9 100644 --- a/src/Ryujinx.Graphics.Shader/Decoders/Block.cs +++ b/src/Ryujinx.Graphics.Shader/Decoders/Block.cs @@ -45,11 +45,11 @@ namespace Ryujinx.Graphics.Shader.Decoders { Address = address; - Predecessors = new List(); - Successors = new List(); + Predecessors = []; + Successors = []; - OpCodes = new List(); - PushOpCodes = new List(); + OpCodes = []; + PushOpCodes = []; SyncTargets = new Dictionary(); } diff --git a/src/Ryujinx.Graphics.Shader/Decoders/DecodedFunction.cs b/src/Ryujinx.Graphics.Shader/Decoders/DecodedFunction.cs index 49cd3a30a..ce702b2ab 100644 --- a/src/Ryujinx.Graphics.Shader/Decoders/DecodedFunction.cs +++ b/src/Ryujinx.Graphics.Shader/Decoders/DecodedFunction.cs @@ -17,7 +17,7 @@ namespace Ryujinx.Graphics.Shader.Decoders public DecodedFunction(ulong address) { Address = address; - _callers = new HashSet(); + _callers = []; Type = FunctionType.User; Id = -1; } diff --git a/src/Ryujinx.Graphics.Shader/Decoders/DecodedProgram.cs b/src/Ryujinx.Graphics.Shader/Decoders/DecodedProgram.cs index fdf3eacc3..be5d0a81b 100644 --- a/src/Ryujinx.Graphics.Shader/Decoders/DecodedProgram.cs +++ b/src/Ryujinx.Graphics.Shader/Decoders/DecodedProgram.cs @@ -27,7 +27,7 @@ namespace Ryujinx.Graphics.Shader.Decoders { MainFunction = mainFunction; _functions = functions; - _functionsWithId = new(); + _functionsWithId = []; AttributeUsage = attributeUsage; UsedFeatures = usedFeatures; ClipDistancesWritten = clipDistancesWritten; diff --git a/src/Ryujinx.Graphics.Shader/Decoders/Decoder.cs b/src/Ryujinx.Graphics.Shader/Decoders/Decoder.cs index 1211e561f..d676fc9e1 100644 --- a/src/Ryujinx.Graphics.Shader/Decoders/Decoder.cs +++ b/src/Ryujinx.Graphics.Shader/Decoders/Decoder.cs @@ -66,7 +66,7 @@ namespace Ryujinx.Graphics.Shader.Decoders while (functionsQueue.TryDequeue(out DecodedFunction currentFunction)) { - List blocks = new(); + List blocks = []; Queue workQueue = new(); Dictionary visited = new(); @@ -520,7 +520,7 @@ namespace Ryujinx.Graphics.Shader.Decoders if (lastOp.Name == InstName.Brx && block.Successors.Count == (hasNext ? 1 : 0)) { - HashSet visited = new(); + HashSet visited = []; InstBrx opBrx = new(lastOp.RawOpCode); ulong baseOffset = lastOp.GetAbsoluteAddress(); @@ -566,7 +566,7 @@ namespace Ryujinx.Graphics.Shader.Decoders // On a successful match, "BaseOffset" is the offset in bytes where the jump offsets are // located on the constant buffer, and "UpperBound" is the total number of offsets for the BRX, minus 1. - HashSet visited = new(); + HashSet visited = []; var ldcLocation = FindFirstRegWrite(visited, new BlockLocation(block, block.OpCodes.Count - 1), brxReg); if (ldcLocation.Block == null || ldcLocation.Block.OpCodes[ldcLocation.Index].Name != InstName.Ldc) @@ -752,7 +752,7 @@ namespace Ryujinx.Graphics.Shader.Decoders Block target = blocks[pushOp.GetAbsoluteAddress()]; Stack workQueue = new(); - HashSet visited = new(); + HashSet visited = []; Stack<(ulong, MergeType)> branchStack = new(); void Push(PathBlockState pbs) diff --git a/src/Ryujinx.Graphics.Shader/Instructions/InstEmitSurface.cs b/src/Ryujinx.Graphics.Shader/Instructions/InstEmitSurface.cs index 383e82c69..946dcc02e 100644 --- a/src/Ryujinx.Graphics.Shader/Instructions/InstEmitSurface.cs +++ b/src/Ryujinx.Graphics.Shader/Instructions/InstEmitSurface.cs @@ -221,7 +221,7 @@ namespace Ryujinx.Graphics.Shader.Instructions Operand d = Register(dest, RegisterType.Gpr); - List sourcesList = new(); + List sourcesList = []; if (isBindless) { @@ -328,7 +328,7 @@ namespace Ryujinx.Graphics.Shader.Instructions return context.Copy(Register(srcA++, RegisterType.Gpr)); } - List sourcesList = new(); + List sourcesList = []; if (isBindless) { @@ -500,7 +500,7 @@ namespace Ryujinx.Graphics.Shader.Instructions return context.Copy(Register(srcB++, RegisterType.Gpr)); } - List sourcesList = new(); + List sourcesList = []; if (isBindless) { @@ -605,7 +605,7 @@ namespace Ryujinx.Graphics.Shader.Instructions return context.Copy(Register(srcB++, RegisterType.Gpr)); } - List sourcesList = new(); + List sourcesList = []; if (isBindless) { diff --git a/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/BasicBlock.cs b/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/BasicBlock.cs index 637e120e1..d3eae3108 100644 --- a/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/BasicBlock.cs +++ b/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/BasicBlock.cs @@ -34,11 +34,11 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation public BasicBlock() { - Operations = new LinkedList(); + Operations = []; - Predecessors = new List(); + Predecessors = []; - DominanceFrontiers = new HashSet(); + DominanceFrontiers = []; } public BasicBlock(int index) : this() diff --git a/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operand.cs b/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operand.cs index 6648457f0..19e65951a 100644 --- a/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operand.cs +++ b/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operand.cs @@ -20,7 +20,7 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation private Operand() { - UseOps = new HashSet(); + UseOps = []; } public Operand(OperandType type) : this() diff --git a/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/PhiNode.cs b/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/PhiNode.cs index f4c4fef42..a32b2e9ee 100644 --- a/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/PhiNode.cs +++ b/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/PhiNode.cs @@ -35,9 +35,9 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation public PhiNode(Operand dest) { - _blocks = new HashSet(); + _blocks = []; - _sources = new List(); + _sources = []; dest.AsgOp = this; diff --git a/src/Ryujinx.Graphics.Shader/StructuredIr/AstBlock.cs b/src/Ryujinx.Graphics.Shader/StructuredIr/AstBlock.cs index 826dbff88..97c0f005e 100644 --- a/src/Ryujinx.Graphics.Shader/StructuredIr/AstBlock.cs +++ b/src/Ryujinx.Graphics.Shader/StructuredIr/AstBlock.cs @@ -41,7 +41,7 @@ namespace Ryujinx.Graphics.Shader.StructuredIr Type = type; Condition = condition; - _nodes = new LinkedList(); + _nodes = []; } public void Add(IAstNode node) diff --git a/src/Ryujinx.Graphics.Shader/StructuredIr/AstOperand.cs b/src/Ryujinx.Graphics.Shader/StructuredIr/AstOperand.cs index b64b96b8d..28aad589f 100644 --- a/src/Ryujinx.Graphics.Shader/StructuredIr/AstOperand.cs +++ b/src/Ryujinx.Graphics.Shader/StructuredIr/AstOperand.cs @@ -17,8 +17,8 @@ namespace Ryujinx.Graphics.Shader.StructuredIr private AstOperand() { - Defs = new HashSet(); - Uses = new HashSet(); + Defs = []; + Uses = []; VarType = AggregateType.S32; } diff --git a/src/Ryujinx.Graphics.Shader/StructuredIr/GotoElimination.cs b/src/Ryujinx.Graphics.Shader/StructuredIr/GotoElimination.cs index 3ca1266f6..687e5942d 100644 --- a/src/Ryujinx.Graphics.Shader/StructuredIr/GotoElimination.cs +++ b/src/Ryujinx.Graphics.Shader/StructuredIr/GotoElimination.cs @@ -429,7 +429,7 @@ namespace Ryujinx.Graphics.Shader.StructuredIr { AstBlock block = bottom; - List path = new(); + List path = []; while (block != top) { diff --git a/src/Ryujinx.Graphics.Shader/StructuredIr/StructuredFunction.cs b/src/Ryujinx.Graphics.Shader/StructuredIr/StructuredFunction.cs index aa5e13867..79fba17cd 100644 --- a/src/Ryujinx.Graphics.Shader/StructuredIr/StructuredFunction.cs +++ b/src/Ryujinx.Graphics.Shader/StructuredIr/StructuredFunction.cs @@ -29,7 +29,7 @@ namespace Ryujinx.Graphics.Shader.StructuredIr InArguments = inArguments; OutArguments = outArguments; - Locals = new HashSet(); + Locals = []; } public AggregateType GetArgumentType(int index) diff --git a/src/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs b/src/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs index 88053658d..dc25f63c4 100644 --- a/src/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs +++ b/src/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs @@ -343,7 +343,7 @@ namespace Ryujinx.Graphics.Shader.StructuredIr private static AggregateType GetVarTypeFromUses(Operand dest) { - HashSet visited = new(); + HashSet visited = []; Queue pending = new(); diff --git a/src/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgramInfo.cs b/src/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgramInfo.cs index ded2f2a89..8118deb89 100644 --- a/src/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgramInfo.cs +++ b/src/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgramInfo.cs @@ -12,9 +12,9 @@ namespace Ryujinx.Graphics.Shader.StructuredIr public StructuredProgramInfo() { - Functions = new List(); + Functions = []; - IoDefinitions = new HashSet(); + IoDefinitions = []; } } } diff --git a/src/Ryujinx.Graphics.Shader/Translation/AttributeUsage.cs b/src/Ryujinx.Graphics.Shader/Translation/AttributeUsage.cs index 9dab9fdf9..5504ef4ed 100644 --- a/src/Ryujinx.Graphics.Shader/Translation/AttributeUsage.cs +++ b/src/Ryujinx.Graphics.Shader/Translation/AttributeUsage.cs @@ -25,8 +25,8 @@ namespace Ryujinx.Graphics.Shader.Translation { _gpuAccessor = gpuAccessor; - UsedInputAttributesPerPatch = new(); - UsedOutputAttributesPerPatch = new(); + UsedInputAttributesPerPatch = []; + UsedOutputAttributesPerPatch = []; } public void SetInputUserAttribute(int index, int component) diff --git a/src/Ryujinx.Graphics.Shader/Translation/ControlFlowGraph.cs b/src/Ryujinx.Graphics.Shader/Translation/ControlFlowGraph.cs index 9b07c28f1..e14044256 100644 --- a/src/Ryujinx.Graphics.Shader/Translation/ControlFlowGraph.cs +++ b/src/Ryujinx.Graphics.Shader/Translation/ControlFlowGraph.cs @@ -13,7 +13,7 @@ namespace Ryujinx.Graphics.Shader.Translation { Blocks = blocks; - HashSet visited = new(); + HashSet visited = []; Stack blockStack = new(); @@ -52,7 +52,7 @@ namespace Ryujinx.Graphics.Shader.Translation { Dictionary labels = new(); - List blocks = new(); + List blocks = []; BasicBlock currentBlock = null; diff --git a/src/Ryujinx.Graphics.Shader/Translation/RegisterUsage.cs b/src/Ryujinx.Graphics.Shader/Translation/RegisterUsage.cs index 1c724223c..1290bab99 100644 --- a/src/Ryujinx.Graphics.Shader/Translation/RegisterUsage.cs +++ b/src/Ryujinx.Graphics.Shader/Translation/RegisterUsage.cs @@ -128,8 +128,8 @@ namespace Ryujinx.Graphics.Shader.Translation public static FunctionRegisterUsage RunPass(ControlFlowGraph cfg) { - List inArguments = new(); - List outArguments = new(); + List inArguments = []; + List outArguments = []; // Compute local register inputs and outputs used inside blocks. RegisterMask[] localInputs = new RegisterMask[cfg.Blocks.Length]; diff --git a/src/Ryujinx.Graphics.Vulkan/BarrierBatch.cs b/src/Ryujinx.Graphics.Vulkan/BarrierBatch.cs index a6a006bb9..3f8ca3401 100644 --- a/src/Ryujinx.Graphics.Vulkan/BarrierBatch.cs +++ b/src/Ryujinx.Graphics.Vulkan/BarrierBatch.cs @@ -19,9 +19,9 @@ namespace Ryujinx.Graphics.Vulkan private readonly NativeArray _bufferBarrierBatch = new(MaxBarriersPerCall); private readonly NativeArray _imageBarrierBatch = new(MaxBarriersPerCall); - private readonly List> _memoryBarriers = new(); - private readonly List> _bufferBarriers = new(); - private readonly List> _imageBarriers = new(); + private readonly List> _memoryBarriers = []; + private readonly List> _bufferBarriers = []; + private readonly List> _imageBarriers = []; private int _queuedBarrierCount; private enum IncoherentBarrierType diff --git a/src/Ryujinx.Graphics.Vulkan/BufferHolder.cs b/src/Ryujinx.Graphics.Vulkan/BufferHolder.cs index e840fdc02..5e05701e9 100644 --- a/src/Ryujinx.Graphics.Vulkan/BufferHolder.cs +++ b/src/Ryujinx.Graphics.Vulkan/BufferHolder.cs @@ -486,7 +486,7 @@ namespace Ryujinx.Graphics.Vulkan (int keyOffset, int keySize) = FromMirrorKey(key); if (!(offset + size <= keyOffset || offset >= keyOffset + keySize)) { - toRemove ??= new List(); + toRemove ??= []; toRemove.Add(key); } diff --git a/src/Ryujinx.Graphics.Vulkan/CacheByRange.cs b/src/Ryujinx.Graphics.Vulkan/CacheByRange.cs index 16954d21b..30414b4df 100644 --- a/src/Ryujinx.Graphics.Vulkan/CacheByRange.cs +++ b/src/Ryujinx.Graphics.Vulkan/CacheByRange.cs @@ -249,7 +249,7 @@ namespace Ryujinx.Graphics.Vulkan { if (entry.DependencyList == null) { - entry.DependencyList = new List(); + entry.DependencyList = []; entries[i] = entry; } @@ -340,7 +340,7 @@ namespace Ryujinx.Graphics.Vulkan DestroyEntry(entry); } - (toRemove ??= new List()).Add(range.Key); + (toRemove ??= []).Add(range.Key); } } @@ -362,7 +362,7 @@ namespace Ryujinx.Graphics.Vulkan if (!_ranges.TryGetValue(key, out List value)) { - value = new List(); + value = []; _ranges.Add(key, value); } diff --git a/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs b/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs index ed76c6566..a5e8835a1 100644 --- a/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs +++ b/src/Ryujinx.Graphics.Vulkan/CommandBufferPool.cs @@ -47,8 +47,8 @@ namespace Ryujinx.Graphics.Vulkan api.AllocateCommandBuffers(device, in allocateInfo, out CommandBuffer); - Dependants = new List(); - Waitables = new List(); + Dependants = []; + Waitables = []; } } diff --git a/src/Ryujinx.Graphics.Vulkan/HostMemoryAllocator.cs b/src/Ryujinx.Graphics.Vulkan/HostMemoryAllocator.cs index ebf0a8bba..cb4648f0a 100644 --- a/src/Ryujinx.Graphics.Vulkan/HostMemoryAllocator.cs +++ b/src/Ryujinx.Graphics.Vulkan/HostMemoryAllocator.cs @@ -44,7 +44,7 @@ namespace Ryujinx.Graphics.Vulkan _hostMemoryApi = hostMemoryApi; _device = device; - _allocations = new List(); + _allocations = []; _allocationTree = new IntervalTree(); } diff --git a/src/Ryujinx.Graphics.Vulkan/IdList.cs b/src/Ryujinx.Graphics.Vulkan/IdList.cs index 598d68584..ced33e39e 100644 --- a/src/Ryujinx.Graphics.Vulkan/IdList.cs +++ b/src/Ryujinx.Graphics.Vulkan/IdList.cs @@ -10,7 +10,7 @@ namespace Ryujinx.Graphics.Vulkan public IdList() { - _list = new List(); + _list = []; _freeMin = 0; } diff --git a/src/Ryujinx.Graphics.Vulkan/ImageArray.cs b/src/Ryujinx.Graphics.Vulkan/ImageArray.cs index 019286d28..959a12849 100644 --- a/src/Ryujinx.Graphics.Vulkan/ImageArray.cs +++ b/src/Ryujinx.Graphics.Vulkan/ImageArray.cs @@ -93,7 +93,7 @@ namespace Ryujinx.Graphics.Vulkan if (storages == null) { - storages = new HashSet(); + storages = []; for (int index = 0; index < _textureRefs.Length; index++) { diff --git a/src/Ryujinx.Graphics.Vulkan/MemoryAllocator.cs b/src/Ryujinx.Graphics.Vulkan/MemoryAllocator.cs index a28322a25..ac31749cf 100644 --- a/src/Ryujinx.Graphics.Vulkan/MemoryAllocator.cs +++ b/src/Ryujinx.Graphics.Vulkan/MemoryAllocator.cs @@ -21,7 +21,7 @@ namespace Ryujinx.Graphics.Vulkan _api = api; _physicalDevice = physicalDevice; _device = device; - _blockLists = new List(); + _blockLists = []; _blockAlignment = (int)Math.Min(int.MaxValue, MaxDeviceMemoryUsageEstimate / _physicalDevice.PhysicalDeviceProperties.Limits.MaxMemoryAllocationCount); _lock = new(LockRecursionPolicy.NoRecursion); } diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineFull.cs b/src/Ryujinx.Graphics.Vulkan/PipelineFull.cs index cf65eefb0..b56e0a05f 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineFull.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineFull.cs @@ -22,10 +22,10 @@ namespace Ryujinx.Graphics.Vulkan public PipelineFull(VulkanRenderer gd, Device device) : base(gd, device) { - _activeQueries = new List<(QueryPool, bool)>(); - _pendingQueryCopies = new(); - _backingSwaps = new(); - _activeBufferMirrors = new(); + _activeQueries = []; + _pendingQueryCopies = []; + _backingSwaps = []; + _activeBufferMirrors = []; CommandBuffer = (Cbs = gd.CommandBufferPool.Rent()).CommandBuffer; } diff --git a/src/Ryujinx.Graphics.Vulkan/PipelineLayoutCacheEntry.cs b/src/Ryujinx.Graphics.Vulkan/PipelineLayoutCacheEntry.cs index ae296b033..c32daefd0 100644 --- a/src/Ryujinx.Graphics.Vulkan/PipelineLayoutCacheEntry.cs +++ b/src/Ryujinx.Graphics.Vulkan/PipelineLayoutCacheEntry.cs @@ -83,7 +83,7 @@ namespace Ryujinx.Graphics.Vulkan for (int j = 0; j < _dsCache[i].Length; j++) { - _dsCache[i][j] = new List>(); + _dsCache[i][j] = []; } } @@ -173,7 +173,7 @@ namespace Ryujinx.Graphics.Vulkan { FreeCompletedManualDescriptorSets(); - var list = _manualDsCache[setIndex] ??= new(); + var list = _manualDsCache[setIndex] ??= []; var span = CollectionsMarshal.AsSpan(list); Queue freeQueue = _freeManualDsCacheEntries[setIndex]; diff --git a/src/Ryujinx.Graphics.Vulkan/RenderPassHolder.cs b/src/Ryujinx.Graphics.Vulkan/RenderPassHolder.cs index a364c5716..2f435e819 100644 --- a/src/Ryujinx.Graphics.Vulkan/RenderPassHolder.cs +++ b/src/Ryujinx.Graphics.Vulkan/RenderPassHolder.cs @@ -144,7 +144,7 @@ namespace Ryujinx.Graphics.Vulkan _textures = textures; _key = key; - _forcedFences = new List(); + _forcedFences = []; } public Auto GetFramebuffer(VulkanRenderer gd, CommandBufferScoped cbs, FramebufferParams fb) diff --git a/src/Ryujinx.Graphics.Vulkan/ResourceLayoutBuilder.cs b/src/Ryujinx.Graphics.Vulkan/ResourceLayoutBuilder.cs index 730a0a2f9..89b788dd2 100644 --- a/src/Ryujinx.Graphics.Vulkan/ResourceLayoutBuilder.cs +++ b/src/Ryujinx.Graphics.Vulkan/ResourceLayoutBuilder.cs @@ -18,8 +18,8 @@ namespace Ryujinx.Graphics.Vulkan for (int index = 0; index < TotalSets; index++) { - _resourceDescriptors[index] = new(); - _resourceUsages[index] = new(); + _resourceDescriptors[index] = []; + _resourceUsages[index] = []; } } diff --git a/src/Ryujinx.Graphics.Vulkan/SyncManager.cs b/src/Ryujinx.Graphics.Vulkan/SyncManager.cs index 35e9ab971..5f6214a4f 100644 --- a/src/Ryujinx.Graphics.Vulkan/SyncManager.cs +++ b/src/Ryujinx.Graphics.Vulkan/SyncManager.cs @@ -33,7 +33,7 @@ namespace Ryujinx.Graphics.Vulkan { _gd = gd; _device = device; - _handles = new List(); + _handles = []; } public void RegisterFlush() diff --git a/src/Ryujinx.Graphics.Vulkan/TextureArray.cs b/src/Ryujinx.Graphics.Vulkan/TextureArray.cs index 99238b1f5..ca8cf7911 100644 --- a/src/Ryujinx.Graphics.Vulkan/TextureArray.cs +++ b/src/Ryujinx.Graphics.Vulkan/TextureArray.cs @@ -113,7 +113,7 @@ namespace Ryujinx.Graphics.Vulkan if (storages == null) { - storages = new HashSet(); + storages = []; for (int index = 0; index < _textureRefs.Length; index++) { diff --git a/src/Ryujinx.HLE.Generators/ServiceSyntaxReceiver.cs b/src/Ryujinx.HLE.Generators/ServiceSyntaxReceiver.cs index e4269cb9a..7513f5f45 100644 --- a/src/Ryujinx.HLE.Generators/ServiceSyntaxReceiver.cs +++ b/src/Ryujinx.HLE.Generators/ServiceSyntaxReceiver.cs @@ -6,7 +6,7 @@ namespace Ryujinx.HLE.Generators { internal class ServiceSyntaxReceiver : ISyntaxReceiver { - public HashSet Types = new HashSet(); + public HashSet Types = []; public void OnVisitSyntaxNode(SyntaxNode syntaxNode) { diff --git a/src/Ryujinx.HLE/HOS/Applets/Browser/BrowserArgument.cs b/src/Ryujinx.HLE/HOS/Applets/Browser/BrowserArgument.cs index d2e1d55ca..24a043358 100644 --- a/src/Ryujinx.HLE/HOS/Applets/Browser/BrowserArgument.cs +++ b/src/Ryujinx.HLE/HOS/Applets/Browser/BrowserArgument.cs @@ -64,7 +64,7 @@ namespace Ryujinx.HLE.HOS.Applets.Browser public static (ShimKind, List) ParseArguments(ReadOnlySpan data) { - List browserArguments = new(); + List browserArguments = []; WebArgHeader header = IApplet.ReadStruct(data[..8]); diff --git a/src/Ryujinx.HLE/HOS/Diagnostics/Demangler/Demangler.cs b/src/Ryujinx.HLE/HOS/Diagnostics/Demangler/Demangler.cs index 171a083f3..ccfb1ee6c 100644 --- a/src/Ryujinx.HLE/HOS/Diagnostics/Demangler/Demangler.cs +++ b/src/Ryujinx.HLE/HOS/Diagnostics/Demangler/Demangler.cs @@ -9,10 +9,10 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler class Demangler { private const string Base36 = "0123456789abcdefghijklmnopqrstuvwxyz"; - private readonly List _substitutionList = new(); - private List _templateParamList = new(); + private readonly List _substitutionList = []; + private List _templateParamList = []; - private readonly List _forwardTemplateReferenceList = new(); + private readonly List _forwardTemplateReferenceList = []; public string Mangled { get; private set; } @@ -274,7 +274,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler } else if (ConsumeIf("Dw")) { - List types = new(); + List types = []; while (!ConsumeIf("E")) { @@ -308,7 +308,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler } Reference referenceQualifier = Reference.None; - List paramsList = new(); + List paramsList = []; while (true) { @@ -1588,7 +1588,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler return null; } - List expressions = new(); + List expressions = []; if (ConsumeIf("_")) { while (!ConsumeIf("E")) @@ -1730,8 +1730,8 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler return null; } - List expressions = new(); - List initializers = new(); + List expressions = []; + List initializers = []; while (!ConsumeIf("_")) { @@ -1899,7 +1899,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler return null; } - List names = new(); + List names = []; while (!ConsumeIf("E")) { expression = ParseExpression(); @@ -2048,7 +2048,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler case 'l': _position += 2; - List bracedExpressions = new(); + List bracedExpressions = []; while (!ConsumeIf("E")) { expression = ParseBracedExpression(); @@ -2327,7 +2327,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler return null; case 'P': _position += 2; - List arguments = new(); + List arguments = []; while (!ConsumeIf("E")) { BaseNode argument = ParseTemplateArgument(); @@ -2368,7 +2368,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler return null; } - List bracedExpressions = new(); + List bracedExpressions = []; while (!ConsumeIf("E")) { expression = ParseBracedExpression(); @@ -2600,7 +2600,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler _templateParamList.Clear(); } - List args = new(); + List args = []; while (!ConsumeIf("E")) { if (hasContext) @@ -2659,7 +2659,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler // J * E case 'J': _position++; - List templateArguments = new(); + List templateArguments = []; while (!ConsumeIf("E")) { BaseNode templateArgument = ParseTemplateArgument(); @@ -3298,7 +3298,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler return new EncodedFunction(name, null, context.Cv, context.Ref, null, returnType); } - List paramsList = new(); + List paramsList = []; // backup because that can be destroyed by parseType CvType cv = context.Cv; diff --git a/src/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs b/src/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs index feba09fe3..7df2b778f 100644 --- a/src/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs +++ b/src/Ryujinx.HLE/HOS/Ipc/IpcMessage.cs @@ -26,13 +26,13 @@ namespace Ryujinx.HLE.HOS.Ipc public IpcMessage() { - PtrBuff = new List(0); - SendBuff = new List(0); - ReceiveBuff = new List(0); - ExchangeBuff = new List(0); - RecvListBuff = new List(0); + PtrBuff = []; + SendBuff = []; + ReceiveBuff = []; + ExchangeBuff = []; + RecvListBuff = []; - ObjectIds = new List(0); + ObjectIds = []; } public IpcMessage(ReadOnlySpan data, long cmdPtr) @@ -122,7 +122,7 @@ namespace Ryujinx.HLE.HOS.Ipc RecvListBuff.Add(new IpcRecvListBuffDesc(reader.ReadUInt64())); } - ObjectIds = new List(0); + ObjectIds = []; } public RecyclableMemoryStream GetStream(long cmdPtr, ulong recvListAddr) diff --git a/src/Ryujinx.HLE/HOS/Kernel/Common/KResourceLimit.cs b/src/Ryujinx.HLE/HOS/Kernel/Common/KResourceLimit.cs index ec3020414..46882a46d 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Common/KResourceLimit.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Common/KResourceLimit.cs @@ -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(); + _waitingThreads = []; } public bool Reserve(LimitableResource resource, ulong amount) diff --git a/src/Ryujinx.HLE/HOS/Kernel/Common/KSynchronizationObject.cs b/src/Ryujinx.HLE/HOS/Kernel/Common/KSynchronizationObject.cs index 7e725e747..50fe01069 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Common/KSynchronizationObject.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Common/KSynchronizationObject.cs @@ -9,7 +9,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Common public KSynchronizationObject(KernelContext context) : base(context) { - WaitingThreads = new LinkedList(); + WaitingThreads = []; } public LinkedListNode AddWaitingThread(KThread thread) diff --git a/src/Ryujinx.HLE/HOS/Kernel/Common/KTimeManager.cs b/src/Ryujinx.HLE/HOS/Kernel/Common/KTimeManager.cs index 3c5fa067f..c24648c65 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Common/KTimeManager.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Common/KTimeManager.cs @@ -34,7 +34,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Common public KTimeManager(KernelContext context) { _context = context; - _waitingObjects = new List(); + _waitingObjects = []; _keepRunning = true; Thread work = new(WaitAndCheckScheduledObjects) diff --git a/src/Ryujinx.HLE/HOS/Kernel/Ipc/KServerPort.cs b/src/Ryujinx.HLE/HOS/Kernel/Ipc/KServerPort.cs index 08efa8d94..d4e0dbfb5 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Ipc/KServerPort.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Ipc/KServerPort.cs @@ -16,8 +16,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Ipc { _parent = parent; - _incomingConnections = new LinkedList(); - _lightIncomingConnections = new LinkedList(); + _incomingConnections = []; + _lightIncomingConnections = []; } public void EnqueueIncomingSession(KServerSession session) diff --git a/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageList.cs b/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageList.cs index 60514824a..c494c1a82 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageList.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageList.cs @@ -10,7 +10,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory public KPageList() { - Nodes = new LinkedList(); + Nodes = []; } public Result AddRange(ulong address, ulong pagesCount) diff --git a/src/Ryujinx.HLE/HOS/Kernel/Memory/KSlabHeap.cs b/src/Ryujinx.HLE/HOS/Kernel/Memory/KSlabHeap.cs index cd8c2e470..bdac2c1ce 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Memory/KSlabHeap.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Memory/KSlabHeap.cs @@ -8,7 +8,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory public KSlabHeap(ulong pa, ulong itemSize, ulong size) { - _items = new LinkedList(); + _items = []; int itemsCount = (int)(size / itemSize); diff --git a/src/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs b/src/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs index 7578f1d2f..654625eee 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Process/HleProcessDebugger.cs @@ -40,7 +40,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process { _owner = owner; - _images = new List(); + _images = []; } public string GetGuestStackTrace(KThread thread) diff --git a/src/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs b/src/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs index 82c3d2e70..32dca1512 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs @@ -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(); + _threads = []; Debugger = new HleProcessDebugger(this); } diff --git a/src/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs b/src/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs index 0c63c7e0e..1219ad442 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Threading/KAddressArbiter.cs @@ -21,8 +21,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading { _context = context; - _condVarThreads = new List(); - _arbiterThreads = new List(); + _condVarThreads = []; + _arbiterThreads = []; } public Result ArbitrateLock(int ownerHandle, ulong mutexAddress, int requesterHandle) diff --git a/src/Ryujinx.HLE/HOS/Kernel/Threading/KPriorityQueue.cs b/src/Ryujinx.HLE/HOS/Kernel/Threading/KPriorityQueue.cs index 1608db095..41674a3a5 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Threading/KPriorityQueue.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Threading/KPriorityQueue.cs @@ -23,8 +23,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading for (int core = 0; core < KScheduler.CpuCoresCount; core++) { - _suggestedThreadsPerPrioPerCore[prio][core] = new LinkedList(); - _scheduledThreadsPerPrioPerCore[prio][core] = new LinkedList(); + _suggestedThreadsPerPrioPerCore[prio][core] = []; + _scheduledThreadsPerPrioPerCore[prio][core] = []; } } diff --git a/src/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs b/src/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs index 4abc0ddf3..cf522453f 100644 --- a/src/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs +++ b/src/Ryujinx.HLE/HOS/Kernel/Threading/KThread.cs @@ -121,8 +121,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading SiblingsPerCore = new LinkedListNode[KScheduler.CpuCoresCount]; - _mutexWaiters = new LinkedList(); - _pinnedWaiters = new LinkedList(); + _mutexWaiters = []; + _pinnedWaiters = []; } public Result Initialize( diff --git a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountSaveDataManager.cs b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountSaveDataManager.cs index b1ef0761c..8c436b1b2 100644 --- a/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountSaveDataManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Account/Acc/AccountSaveDataManager.cs @@ -53,7 +53,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc { ProfilesJson profilesJson = new() { - Profiles = new List(), + Profiles = [], LastOpened = LastOpened.ToString(), }; diff --git a/src/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs b/src/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs index 858d6201d..bd6508545 100644 --- a/src/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs +++ b/src/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs @@ -852,8 +852,8 @@ namespace Ryujinx.HLE.HOS.Services.Hid // Initialize entries to avoid issues with some games. - List emptyGamepadInputs = new(); - List emptySixAxisInputs = new(); + List emptyGamepadInputs = []; + List emptySixAxisInputs = []; for (int player = 0; player < NpadDevices.MaxControllers; player++) { diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/EphemeralPortPool.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/EphemeralPortPool.cs index 9ea56d050..75cc15a98 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/EphemeralPortPool.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/EphemeralPortPool.cs @@ -7,7 +7,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy { private const ushort EphemeralBase = 49152; - private readonly List _ephemeralPorts = new List(); + private readonly List _ephemeralPorts = []; private readonly Lock _lock = new(); diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/LdnProxy.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/LdnProxy.cs index bb390d49a..9bd52b3e6 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/LdnProxy.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/LdnProxy.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy public EndPoint LocalEndpoint { get; } public IPAddress LocalAddress { get; } - private readonly List _sockets = new List(); + private readonly List _sockets = []; private readonly Dictionary _ephemeralPorts = new Dictionary(); private readonly IProxyClient _parent; diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/LdnProxySocket.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/LdnProxySocket.cs index ed7a9c751..c4401df2c 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/LdnProxySocket.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/LdnProxySocket.cs @@ -18,7 +18,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy private readonly LdnProxy _proxy; private bool _isListening; - private readonly List _listenSockets = new List(); + private readonly List _listenSockets = []; private readonly Queue _connectRequests = new Queue(); diff --git a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/P2pProxyServer.cs b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/P2pProxyServer.cs index 68d9b1a5b..e78ad1fd0 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/P2pProxyServer.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ldn/UserServiceCreator/LdnRyu/Proxy/P2pProxyServer.cs @@ -39,9 +39,9 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnRyu.Proxy private NatDevice _natDevice; private Mapping _portMapping; - private readonly List _players = new List(); + private readonly List _players = []; - private readonly List _waitingTokens = new List(); + private readonly List _waitingTokens = []; private readonly AutoResetEvent _tokenEvent = new AutoResetEvent(false); private uint _broadcastAddress; diff --git a/src/Ryujinx.HLE/HOS/Services/Nfc/AmiiboDecryption/AmiiboDump.cs b/src/Ryujinx.HLE/HOS/Services/Nfc/AmiiboDecryption/AmiiboDump.cs index 7343a40ca..37d587dac 100644 --- a/src/Ryujinx.HLE/HOS/Services/Nfc/AmiiboDecryption/AmiiboDump.cs +++ b/src/Ryujinx.HLE/HOS/Services/Nfc/AmiiboDecryption/AmiiboDump.cs @@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.AmiiboDecryption private byte[] DeriveKey(AmiiboMasterKey key, bool deriveAes, out byte[] derivedAesKey, out byte[] derivedAesIv) { - List seed = new List(); + List seed = []; // Start with the type string (14 bytes) seed.AddRange(key.TypeString); diff --git a/src/Ryujinx.HLE/HOS/Services/Nifm/StaticService/GeneralService/GeneralServiceManager.cs b/src/Ryujinx.HLE/HOS/Services/Nifm/StaticService/GeneralService/GeneralServiceManager.cs index 16eefc87d..5ad241e0f 100644 --- a/src/Ryujinx.HLE/HOS/Services/Nifm/StaticService/GeneralService/GeneralServiceManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Nifm/StaticService/GeneralService/GeneralServiceManager.cs @@ -5,7 +5,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService.GeneralService { static class GeneralServiceManager { - private static readonly List _generalServices = new(); + private static readonly List _generalServices = []; public static int Count { diff --git a/src/Ryujinx.HLE/HOS/Services/Ns/Aoc/IAddOnContentManager.cs b/src/Ryujinx.HLE/HOS/Services/Ns/Aoc/IAddOnContentManager.cs index 083a83214..c77358803 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ns/Aoc/IAddOnContentManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ns/Aoc/IAddOnContentManager.cs @@ -15,7 +15,7 @@ namespace Ryujinx.HLE.HOS.Services.Ns.Aoc private ulong _addOnContentBaseId; - private readonly List _mountedAocTitleIds = new(); + private readonly List _mountedAocTitleIds = []; public IAddOnContentManager(ServiceCtx context) { diff --git a/src/Ryujinx.HLE/HOS/Services/Nv/NvMemoryAllocator.cs b/src/Ryujinx.HLE/HOS/Services/Nv/NvMemoryAllocator.cs index 4e8193302..3b8840a3d 100644 --- a/src/Ryujinx.HLE/HOS/Services/Nv/NvMemoryAllocator.cs +++ b/src/Ryujinx.HLE/HOS/Services/Nv/NvMemoryAllocator.cs @@ -23,7 +23,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv private readonly TreeDictionary _tree = new(); private readonly Dictionary> _dictionary = new(); - private readonly LinkedList _list = new(); + private readonly LinkedList _list = []; public NvMemoryAllocator() { diff --git a/src/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs b/src/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs index 5b5b3bf84..17d0b96ef 100644 --- a/src/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs +++ b/src/Ryujinx.HLE/HOS/Services/Ro/IRoInterface.cs @@ -64,7 +64,7 @@ namespace Ryujinx.HLE.HOS.Services.Ro return ResultCode.InvalidSize; } - List hashes = new(); + List hashes = []; for (int i = 0; i < header.HashesCount; i++) { diff --git a/src/Ryujinx.HLE/HOS/Services/Sdb/Pdm/QueryService/QueryPlayStatisticsManager.cs b/src/Ryujinx.HLE/HOS/Services/Sdb/Pdm/QueryService/QueryPlayStatisticsManager.cs index 56d389cd2..516261595 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sdb/Pdm/QueryService/QueryPlayStatisticsManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sdb/Pdm/QueryService/QueryPlayStatisticsManager.cs @@ -33,7 +33,7 @@ namespace Ryujinx.HLE.HOS.Services.Sdb.Pdm.QueryService PlayLogQueryCapability queryCapability = (PlayLogQueryCapability)context.Device.Processes.ActiveApplication.ApplicationControlProperties.PlayLogQueryCapability; - List titleIds = new(); + List titleIds = []; for (ulong i = 0; i < inputSize / sizeof(ulong); i++) { diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs index 9d5bb8d01..d3a88998f 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/BsdContext.cs @@ -17,7 +17,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd private BsdContext() { - _fds = new List(); + _fds = []; } public ISocket RetrieveSocket(int socketFd) @@ -47,7 +47,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd public List RetrieveFileDescriptorsFromMask(ReadOnlySpan mask) { - List fds = new(); + List fds = []; for (int i = 0; i < mask.Length; i++) { diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/EventFileDescriptorPollManager.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/EventFileDescriptorPollManager.cs index a29554c35..99e3abdf8 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/EventFileDescriptorPollManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/EventFileDescriptorPollManager.cs @@ -28,7 +28,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl { updatedCount = 0; - List waiters = new(); + List waiters = []; for (int i = 0; i < events.Count; i++) { diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocketPollManager.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocketPollManager.cs index e870e8aea..a1daa87c0 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocketPollManager.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Bsd/Impl/ManagedSocketPollManager.cs @@ -27,9 +27,9 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl public LinuxError Poll(List events, int timeoutMilliseconds, out int updatedCount) { - List readEvents = new(); - List writeEvents = new(); - List errorEvents = new(); + List readEvents = []; + List writeEvents = []; + List errorEvents = []; updatedCount = 0; @@ -123,9 +123,9 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Bsd.Impl public LinuxError Select(List events, int timeout, out int updatedCount) { - List readEvents = new(); - List writeEvents = new(); - List errorEvents = new(); + List readEvents = []; + List writeEvents = []; + List errorEvents = []; updatedCount = 0; diff --git a/src/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs b/src/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs index 5b2de13f0..80bdbec8a 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sockets/Sfdnsres/IResolver.cs @@ -604,7 +604,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres private static List DeserializeAddrInfos(IVirtualMemoryManager memory, ulong address, ulong size) { - List result = new(); + List result = []; ReadOnlySpan data = memory.GetSpan(address, (int)size); diff --git a/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueCore.cs b/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueCore.cs index 5dc02a07e..770149489 100644 --- a/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueCore.cs +++ b/src/Ryujinx.HLE/HOS/Services/SurfaceFlinger/BufferQueueCore.cs @@ -66,7 +66,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger ConsumerListener = null; ConsumerUsageBits = 0; - Queue = new List(); + Queue = []; // TODO: CreateGraphicBufferAlloc? diff --git a/src/Ryujinx.HLE/HOS/Services/Time/Clock/SystemClockContextUpdateCallback.cs b/src/Ryujinx.HLE/HOS/Services/Time/Clock/SystemClockContextUpdateCallback.cs index 119096dcf..781f72ead 100644 --- a/src/Ryujinx.HLE/HOS/Services/Time/Clock/SystemClockContextUpdateCallback.cs +++ b/src/Ryujinx.HLE/HOS/Services/Time/Clock/SystemClockContextUpdateCallback.cs @@ -12,7 +12,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.Clock public SystemClockContextUpdateCallback() { - _operationEventList = new List(); + _operationEventList = []; Context = new SystemClockContext(); _hasContext = false; } diff --git a/src/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs b/src/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs index a2b1fb524..460d766b9 100644 --- a/src/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs +++ b/src/Ryujinx.HLE/HOS/Services/Vi/RootService/IApplicationDisplayService.cs @@ -34,7 +34,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService public IApplicationDisplayService(ViServiceType serviceType) { _serviceType = serviceType; - _displayInfo = new List(); + _displayInfo = []; _openDisplays = new Dictionary(); void AddDisplayInfo(string name, bool layerLimitEnabled, ulong layerLimitMax, ulong width, ulong height) diff --git a/src/Ryujinx.HLE/HOS/Tamper/OperationBlock.cs b/src/Ryujinx.HLE/HOS/Tamper/OperationBlock.cs index 5a0bccc5d..1e856294a 100644 --- a/src/Ryujinx.HLE/HOS/Tamper/OperationBlock.cs +++ b/src/Ryujinx.HLE/HOS/Tamper/OperationBlock.cs @@ -11,7 +11,7 @@ namespace Ryujinx.HLE.HOS.Tamper public OperationBlock(byte[] baseInstruction) { BaseInstruction = baseInstruction; - Operations = new List(); + Operations = []; } } } diff --git a/src/Ryujinx.Headless.SDL2/Program.cs b/src/Ryujinx.Headless.SDL2/Program.cs index 4bab51144..ad0aba81c 100644 --- a/src/Ryujinx.Headless.SDL2/Program.cs +++ b/src/Ryujinx.Headless.SDL2/Program.cs @@ -392,7 +392,7 @@ namespace Ryujinx.Headless.SDL2 return; } - _inputConfiguration = new List(); + _inputConfiguration = []; _enableKeyboard = option.EnableKeyboard; _enableMouse = option.EnableMouse; diff --git a/src/Ryujinx.Horizon.Generators/Hipc/CommandInterface.cs b/src/Ryujinx.Horizon.Generators/Hipc/CommandInterface.cs index 2dcdfe5a2..8ed9669ba 100644 --- a/src/Ryujinx.Horizon.Generators/Hipc/CommandInterface.cs +++ b/src/Ryujinx.Horizon.Generators/Hipc/CommandInterface.cs @@ -11,7 +11,7 @@ namespace Ryujinx.Horizon.Generators.Hipc public CommandInterface(ClassDeclarationSyntax classDeclarationSyntax) { ClassDeclarationSyntax = classDeclarationSyntax; - CommandImplementations = new List(); + CommandImplementations = []; } } } diff --git a/src/Ryujinx.Horizon.Generators/Hipc/HipcGenerator.cs b/src/Ryujinx.Horizon.Generators/Hipc/HipcGenerator.cs index d1be8298d..ae3509b13 100644 --- a/src/Ryujinx.Horizon.Generators/Hipc/HipcGenerator.cs +++ b/src/Ryujinx.Horizon.Generators/Hipc/HipcGenerator.cs @@ -257,7 +257,7 @@ namespace Ryujinx.Horizon.Generators.Hipc generator.AppendLine(); } - List outParameters = new List(); + List outParameters = []; string[] args = new string[method.ParameterList.Parameters.Count]; diff --git a/src/Ryujinx.Horizon.Generators/Hipc/HipcSyntaxReceiver.cs b/src/Ryujinx.Horizon.Generators/Hipc/HipcSyntaxReceiver.cs index 9b3421076..adbc09d7c 100644 --- a/src/Ryujinx.Horizon.Generators/Hipc/HipcSyntaxReceiver.cs +++ b/src/Ryujinx.Horizon.Generators/Hipc/HipcSyntaxReceiver.cs @@ -12,7 +12,7 @@ namespace Ryujinx.Horizon.Generators.Hipc public HipcSyntaxReceiver() { - CommandInterfaces = new List(); + CommandInterfaces = []; } public void OnVisitSyntaxNode(SyntaxNode syntaxNode) diff --git a/src/Ryujinx.Horizon.Kernel.Generators/SyscallSyntaxReceiver.cs b/src/Ryujinx.Horizon.Kernel.Generators/SyscallSyntaxReceiver.cs index 1542fed6a..e25c6317b 100644 --- a/src/Ryujinx.Horizon.Kernel.Generators/SyscallSyntaxReceiver.cs +++ b/src/Ryujinx.Horizon.Kernel.Generators/SyscallSyntaxReceiver.cs @@ -11,7 +11,7 @@ namespace Ryujinx.Horizon.Kernel.Generators public SyscallSyntaxReceiver() { - SvcImplementations = new List(); + SvcImplementations = []; } public void OnVisitSyntaxNode(SyntaxNode syntaxNode) diff --git a/src/Ryujinx.Horizon/HeapAllocator.cs b/src/Ryujinx.Horizon/HeapAllocator.cs index fc125387e..a9152f795 100644 --- a/src/Ryujinx.Horizon/HeapAllocator.cs +++ b/src/Ryujinx.Horizon/HeapAllocator.cs @@ -31,7 +31,7 @@ namespace Ryujinx.Horizon public HeapAllocator() { - _freeRanges = new List(); + _freeRanges = []; _currentHeapSize = 0; } diff --git a/src/Ryujinx.Horizon/MmNv/Ipc/Request.cs b/src/Ryujinx.Horizon/MmNv/Ipc/Request.cs index c53ca1866..a3b4e0f83 100644 --- a/src/Ryujinx.Horizon/MmNv/Ipc/Request.cs +++ b/src/Ryujinx.Horizon/MmNv/Ipc/Request.cs @@ -8,7 +8,7 @@ namespace Ryujinx.Horizon.MmNv.Ipc { partial class Request : IRequest { - private readonly List _sessionList = new(); + private readonly List _sessionList = []; private uint _uniqueId = 1; diff --git a/src/Ryujinx.Horizon/Sdk/Friends/Detail/Ipc/NotificationService.cs b/src/Ryujinx.Horizon/Sdk/Friends/Detail/Ipc/NotificationService.cs index 585b40df3..d9ad40c94 100644 --- a/src/Ryujinx.Horizon/Sdk/Friends/Detail/Ipc/NotificationService.cs +++ b/src/Ryujinx.Horizon/Sdk/Friends/Detail/Ipc/NotificationService.cs @@ -28,7 +28,7 @@ namespace Ryujinx.Horizon.Sdk.Friends.Detail.Ipc _notificationEventHandler = notificationEventHandler; _userId = userId; _permissionLevel = permissionLevel; - _notifications = new LinkedList(); + _notifications = []; Os.CreateSystemEvent(out _notificationEvent, EventClearMode.AutoClear, interProcess: true).AbortOnFailure(); _hasNewFriendRequest = false; diff --git a/src/Ryujinx.Horizon/Sdk/OsTypes/Impl/MultiWaitImpl.cs b/src/Ryujinx.Horizon/Sdk/OsTypes/Impl/MultiWaitImpl.cs index 879a3a58f..2fbcfdc88 100644 --- a/src/Ryujinx.Horizon/Sdk/OsTypes/Impl/MultiWaitImpl.cs +++ b/src/Ryujinx.Horizon/Sdk/OsTypes/Impl/MultiWaitImpl.cs @@ -26,7 +26,7 @@ namespace Ryujinx.Horizon.Sdk.OsTypes.Impl public MultiWaitImpl() { - _multiWaits = new List(); + _multiWaits = []; } public void LinkMultiWaitHolder(MultiWaitHolderBase multiWaitHolder) diff --git a/src/Ryujinx.Horizon/Sdk/OsTypes/OsEvent.cs b/src/Ryujinx.Horizon/Sdk/OsTypes/OsEvent.cs index 8efe614f2..422f756e4 100644 --- a/src/Ryujinx.Horizon/Sdk/OsTypes/OsEvent.cs +++ b/src/Ryujinx.Horizon/Sdk/OsTypes/OsEvent.cs @@ -10,7 +10,7 @@ namespace Ryujinx.Horizon.Sdk.OsTypes { evnt = new EventType { - MultiWaitHolders = new LinkedList(), + MultiWaitHolders = [], Signaled = signaled, InitiallySignaled = signaled, ClearMode = clearMode, diff --git a/src/Ryujinx.Horizon/Sdk/Sf/Cmif/ServerDomainManager.cs b/src/Ryujinx.Horizon/Sdk/Sf/Cmif/ServerDomainManager.cs index 13f9fb7a9..8198efd7c 100644 --- a/src/Ryujinx.Horizon/Sdk/Sf/Cmif/ServerDomainManager.cs +++ b/src/Ryujinx.Horizon/Sdk/Sf/Cmif/ServerDomainManager.cs @@ -27,7 +27,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif public EntryManager(int count) { - _freeList = new LinkedList(); + _freeList = []; _entries = new Entry[count]; for (int i = 0; i < count; i++) @@ -87,7 +87,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif public Domain(ServerDomainManager manager) { _manager = manager; - _entries = new LinkedList(); + _entries = []; } public override ServiceObjectHolder GetObject(int id) @@ -217,7 +217,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif public ServerDomainManager(int entryCount, int maxDomains) { _entryManager = new EntryManager(entryCount); - _domains = new HashSet(); + _domains = []; _maxDomains = maxDomains; } diff --git a/src/Ryujinx.Horizon/Sdk/Sf/Hipc/ServerManager.cs b/src/Ryujinx.Horizon/Sdk/Sf/Hipc/ServerManager.cs index 6aa32faee..df121164f 100644 --- a/src/Ryujinx.Horizon/Sdk/Sf/Hipc/ServerManager.cs +++ b/src/Ryujinx.Horizon/Sdk/Sf/Hipc/ServerManager.cs @@ -44,8 +44,8 @@ namespace Ryujinx.Horizon.Sdk.Sf.Hipc } _sessionAllocationBitmap = new ulong[(maxSessions + 63) / 64]; - _sessions = new HashSet(); - _servers = new HashSet(); + _sessions = []; + _servers = []; } private static PointerAndSize GetObjectBySessionIndex(ServerSession session, ulong baseAddress, ulong size) diff --git a/src/Ryujinx.Horizon/ServiceTable.cs b/src/Ryujinx.Horizon/ServiceTable.cs index 28c43a716..db24c193d 100644 --- a/src/Ryujinx.Horizon/ServiceTable.cs +++ b/src/Ryujinx.Horizon/ServiceTable.cs @@ -33,7 +33,7 @@ namespace Ryujinx.Horizon public IEnumerable GetServices(HorizonOptions options) { - List entries = new(); + List entries = []; void RegisterService() where T : IService { diff --git a/src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs b/src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs index 1e7ad05ce..e0ec35de7 100644 --- a/src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs +++ b/src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs @@ -31,7 +31,7 @@ namespace Ryujinx.Input.SDL2 public SDL2GamepadDriver() { _gamepadsInstanceIdsMapping = new Dictionary(); - _gamepadsIds = new List(); + _gamepadsIds = []; SDL2Driver.Instance.Initialize(); SDL2Driver.Instance.OnJoyStickConnected += HandleJoyStickConnected; diff --git a/src/Ryujinx.Input/HLE/NpadManager.cs b/src/Ryujinx.Input/HLE/NpadManager.cs index 08f222a91..8824dade6 100644 --- a/src/Ryujinx.Input/HLE/NpadManager.cs +++ b/src/Ryujinx.Input/HLE/NpadManager.cs @@ -45,7 +45,7 @@ namespace Ryujinx.Input.HLE _keyboardDriver = keyboardDriver; _gamepadDriver = gamepadDriver; _mouseDriver = mouseDriver; - _inputConfig = new List(); + _inputConfig = []; _gamepadDriver.OnGamepadConnected += HandleOnGamepadConnected; _gamepadDriver.OnGamepadDisconnected += HandleOnGamepadDisconnected; diff --git a/src/Ryujinx.Memory/SparseMemoryBlock.cs b/src/Ryujinx.Memory/SparseMemoryBlock.cs index 5717d7b64..7e46370d0 100644 --- a/src/Ryujinx.Memory/SparseMemoryBlock.cs +++ b/src/Ryujinx.Memory/SparseMemoryBlock.cs @@ -28,7 +28,7 @@ namespace Ryujinx.Memory { _pageSize = MemoryBlock.GetPageSize(); _reservedBlock = new MemoryBlock(size, MemoryAllocationFlags.Reserve | MemoryAllocationFlags.ViewCompatible); - _mappedBlocks = new List(); + _mappedBlocks = []; _pageInit = pageInit; int pages = (int)BitUtils.DivRoundUp(size, _pageSize); diff --git a/src/Ryujinx.Memory/Tracking/MemoryTracking.cs b/src/Ryujinx.Memory/Tracking/MemoryTracking.cs index 96cb2c5f5..fb5659d5f 100644 --- a/src/Ryujinx.Memory/Tracking/MemoryTracking.cs +++ b/src/Ryujinx.Memory/Tracking/MemoryTracking.cs @@ -51,8 +51,8 @@ namespace Ryujinx.Memory.Tracking _invalidAccessHandler = invalidAccessHandler; _singleByteGuestTracking = singleByteGuestTracking; - _virtualRegions = new NonOverlappingRangeList(); - _guestVirtualRegions = new NonOverlappingRangeList(); + _virtualRegions = []; + _guestVirtualRegions = []; } private (ulong address, ulong size) PageAlign(ulong address, ulong size) @@ -165,7 +165,7 @@ namespace Ryujinx.Memory.Tracking /// A list of virtual regions within the given range internal List GetVirtualRegionsForHandle(ulong va, ulong size, bool guest) { - List result = new(); + List result = []; NonOverlappingRangeList regions = guest ? _guestVirtualRegions : _virtualRegions; regions.GetOrAddRegions(result, va, size, (va, size) => new VirtualRegion(this, va, size, guest)); diff --git a/src/Ryujinx.Memory/Tracking/VirtualRegion.cs b/src/Ryujinx.Memory/Tracking/VirtualRegion.cs index 35e9c2d9b..3ed452ee1 100644 --- a/src/Ryujinx.Memory/Tracking/VirtualRegion.cs +++ b/src/Ryujinx.Memory/Tracking/VirtualRegion.cs @@ -8,7 +8,7 @@ namespace Ryujinx.Memory.Tracking /// class VirtualRegion : AbstractRegion { - public List Handles = new(); + public List Handles = []; private readonly MemoryTracking _tracking; private MemoryPermission _lastPermission; diff --git a/src/Ryujinx.Tests.Memory/TrackingTests.cs b/src/Ryujinx.Tests.Memory/TrackingTests.cs index c74446cfb..675179ede 100644 --- a/src/Ryujinx.Tests.Memory/TrackingTests.cs +++ b/src/Ryujinx.Tests.Memory/TrackingTests.cs @@ -214,7 +214,7 @@ namespace Ryujinx.Tests.Memory handles[i].Reprotect(); } - List testThreads = new(); + List testThreads = []; // Dirty flag consumer threads int dirtyFlagReprotects = 0; diff --git a/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs b/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs index 311260fa5..005f70896 100644 --- a/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs +++ b/src/Ryujinx.UI.Common/App/ApplicationLibrary.cs @@ -661,7 +661,7 @@ namespace Ryujinx.UI.App.Common _applications.Clear(); // Builds the applications list with paths to found applications - List applicationPaths = new(); + List applicationPaths = []; try { @@ -854,7 +854,7 @@ namespace Ryujinx.UI.App.Common { _cancellationToken = new CancellationTokenSource(); - List dlcPaths = new(); + List dlcPaths = []; int newDlcLoaded = 0; numDlcRemoved = 0; @@ -967,7 +967,7 @@ namespace Ryujinx.UI.App.Common { _cancellationToken = new CancellationTokenSource(); - List updatePaths = new(); + List updatePaths = []; int numUpdatesLoaded = 0; numUpdatesRemoved = 0; diff --git a/src/Ryujinx.UI.Common/Helper/CommandLineState.cs b/src/Ryujinx.UI.Common/Helper/CommandLineState.cs index c33323c68..986fe0a7d 100644 --- a/src/Ryujinx.UI.Common/Helper/CommandLineState.cs +++ b/src/Ryujinx.UI.Common/Helper/CommandLineState.cs @@ -23,7 +23,7 @@ namespace Ryujinx.UI.Common.Helper public static void ParseArguments(string[] args) { - List arguments = new(); + List arguments = []; // Parse Arguments. for (int i = 0; i < args.Length; ++i) diff --git a/src/Ryujinx.UI.Common/Helper/DownloadableContentsHelper.cs b/src/Ryujinx.UI.Common/Helper/DownloadableContentsHelper.cs index 3695c5c5c..f7a109379 100644 --- a/src/Ryujinx.UI.Common/Helper/DownloadableContentsHelper.cs +++ b/src/Ryujinx.UI.Common/Helper/DownloadableContentsHelper.cs @@ -45,7 +45,7 @@ namespace Ryujinx.UI.Common.Helper public static void SaveDownloadableContentsJson(VirtualFileSystem vfs, ulong applicationIdBase, List<(DownloadableContentModel, bool IsEnabled)> dlcs) { DownloadableContentContainer container = default; - List downloadableContentContainerList = new(); + List downloadableContentContainerList = []; foreach ((DownloadableContentModel dlc, bool isEnabled) in dlcs) { diff --git a/src/Ryujinx/Input/AvaloniaKeyboard.cs b/src/Ryujinx/Input/AvaloniaKeyboard.cs index 7c82519ed..f13577adf 100644 --- a/src/Ryujinx/Input/AvaloniaKeyboard.cs +++ b/src/Ryujinx/Input/AvaloniaKeyboard.cs @@ -38,7 +38,7 @@ namespace Ryujinx.Ava.Input public AvaloniaKeyboard(AvaloniaKeyboardDriver driver, string id, string name) { - _buttonsUserMapping = new List(); + _buttonsUserMapping = []; _driver = driver; Id = id; diff --git a/src/Ryujinx/UI/Controls/ApplicationContextMenu.axaml.cs b/src/Ryujinx/UI/Controls/ApplicationContextMenu.axaml.cs index 4ee79cf3e..94874e462 100644 --- a/src/Ryujinx/UI/Controls/ApplicationContextMenu.axaml.cs +++ b/src/Ryujinx/UI/Controls/ApplicationContextMenu.axaml.cs @@ -173,7 +173,7 @@ namespace Ryujinx.Ava.UI.Controls DirectoryInfo mainDir = new(Path.Combine(AppDataManager.GamesDirPath, viewModel.SelectedApplication.IdString, "cache", "cpu", "0")); DirectoryInfo backupDir = new(Path.Combine(AppDataManager.GamesDirPath, viewModel.SelectedApplication.IdString, "cache", "cpu", "1")); - List cacheFiles = new(); + List cacheFiles = []; if (mainDir.Exists) { @@ -218,7 +218,7 @@ namespace Ryujinx.Ava.UI.Controls DirectoryInfo mainDir = new(Path.Combine(AppDataManager.GamesDirPath, viewModel.SelectedApplication.IdString, "cache", "cpu", "0")); DirectoryInfo backupDir = new(Path.Combine(AppDataManager.GamesDirPath, viewModel.SelectedApplication.IdString, "cache", "cpu", "1")); - List cacheFiles = new(); + List cacheFiles = []; if (mainDir.Exists) { @@ -266,8 +266,8 @@ namespace Ryujinx.Ava.UI.Controls { DirectoryInfo shaderCacheDir = new(Path.Combine(AppDataManager.GamesDirPath, viewModel.SelectedApplication.IdString, "cache", "shader")); - List oldCacheDirectories = new(); - List newCacheFiles = new(); + List oldCacheDirectories = []; + List newCacheFiles = []; if (shaderCacheDir.Exists) { diff --git a/src/Ryujinx/UI/Controls/NavigationDialogHost.axaml.cs b/src/Ryujinx/UI/Controls/NavigationDialogHost.axaml.cs index a32c052bf..be7b6d75f 100644 --- a/src/Ryujinx/UI/Controls/NavigationDialogHost.axaml.cs +++ b/src/Ryujinx/UI/Controls/NavigationDialogHost.axaml.cs @@ -124,7 +124,7 @@ namespace Ryujinx.Ava.UI.Controls Span saveDataInfo = stackalloc SaveDataInfo[10]; - HashSet lostAccounts = new(); + HashSet lostAccounts = []; while (true) { diff --git a/src/Ryujinx/UI/Models/CheatNode.cs b/src/Ryujinx/UI/Models/CheatNode.cs index 153a1891a..9179fb0ef 100644 --- a/src/Ryujinx/UI/Models/CheatNode.cs +++ b/src/Ryujinx/UI/Models/CheatNode.cs @@ -8,7 +8,7 @@ namespace Ryujinx.Ava.UI.Models public class CheatNode : BaseModel { private bool _isEnabled = false; - public ObservableCollection SubNodes { get; } = new(); + public ObservableCollection SubNodes { get; } = []; public string CleanName => Name.Length > 0 ? Name[1..^7] : Name; public string BuildIdKey => $"{BuildId}-{Name}"; public bool IsRootNode { get; } diff --git a/src/Ryujinx/UI/ViewModels/AmiiboWindowViewModel.cs b/src/Ryujinx/UI/ViewModels/AmiiboWindowViewModel.cs index e9dbb3d6b..ad2601c36 100644 --- a/src/Ryujinx/UI/ViewModels/AmiiboWindowViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/AmiiboWindowViewModel.cs @@ -61,9 +61,9 @@ namespace Ryujinx.Ava.UI.ViewModels Directory.CreateDirectory(Path.Join(AppDataManager.BaseDirPath, "system", "amiibo")); _amiiboJsonPath = Path.Join(AppDataManager.BaseDirPath, "system", "amiibo", "Amiibo.json"); - _amiiboList = new List(); - _amiiboSeries = new ObservableCollection(); - _amiibos = new AvaloniaList(); + _amiiboList = []; + _amiiboSeries = []; + _amiibos = []; _amiiboLogoBytes = EmbeddedResources.Read("Ryujinx.UI.Common/Resources/Logo_Amiibo.png"); diff --git a/src/Ryujinx/UI/ViewModels/ModManagerViewModel.cs b/src/Ryujinx/UI/ViewModels/ModManagerViewModel.cs index c5ac687c5..839430f62 100644 --- a/src/Ryujinx/UI/ViewModels/ModManagerViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/ModManagerViewModel.cs @@ -23,9 +23,9 @@ namespace Ryujinx.Ava.UI.ViewModels { private readonly string _modJsonPath; - private AvaloniaList _mods = new(); - private AvaloniaList _views = new(); - private AvaloniaList _selectedMods = new(); + private AvaloniaList _mods = []; + private AvaloniaList _views = []; + private AvaloniaList _selectedMods = []; private string _search; private readonly ulong _applicationId; diff --git a/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs b/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs index ac223d486..f421ec9e0 100644 --- a/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/SettingsViewModel.cs @@ -390,11 +390,11 @@ namespace Ryujinx.Ava.UI.ViewModels public SettingsViewModel() { - GameDirectories = new AvaloniaList(); - AutoloadDirectories = new AvaloniaList(); - TimeZones = new AvaloniaList(); - AvailableGpus = new ObservableCollection(); - _validTzRegions = new List(); + GameDirectories = []; + AutoloadDirectories = []; + TimeZones = []; + AvailableGpus = []; + _validTzRegions = []; _networkInterfaces = new Dictionary(); Task.Run(CheckSoundBackends); diff --git a/src/Ryujinx/UI/ViewModels/UserFirmwareAvatarSelectorViewModel.cs b/src/Ryujinx/UI/ViewModels/UserFirmwareAvatarSelectorViewModel.cs index b07bf78b9..468c7334d 100644 --- a/src/Ryujinx/UI/ViewModels/UserFirmwareAvatarSelectorViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/UserFirmwareAvatarSelectorViewModel.cs @@ -31,7 +31,7 @@ namespace Ryujinx.Ava.UI.ViewModels public UserFirmwareAvatarSelectorViewModel() { - _images = new ObservableCollection(); + _images = []; LoadImagesFromStore(); } diff --git a/src/Ryujinx/UI/ViewModels/UserProfileViewModel.cs b/src/Ryujinx/UI/ViewModels/UserProfileViewModel.cs index 0b65e6d13..f3a9e432a 100644 --- a/src/Ryujinx/UI/ViewModels/UserProfileViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/UserProfileViewModel.cs @@ -9,8 +9,8 @@ namespace Ryujinx.Ava.UI.ViewModels { public UserProfileViewModel() { - Profiles = new ObservableCollection(); - LostProfiles = new ObservableCollection(); + Profiles = []; + LostProfiles = []; IsEmpty = !LostProfiles.Any(); } diff --git a/src/Ryujinx/UI/ViewModels/UserSaveManagerViewModel.cs b/src/Ryujinx/UI/ViewModels/UserSaveManagerViewModel.cs index 85adef005..992da81f5 100644 --- a/src/Ryujinx/UI/ViewModels/UserSaveManagerViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/UserSaveManagerViewModel.cs @@ -13,8 +13,8 @@ namespace Ryujinx.Ava.UI.ViewModels private int _sortIndex; private int _orderIndex; private string _search; - private ObservableCollection _saves = new(); - private ObservableCollection _views = new(); + private ObservableCollection _saves = []; + private ObservableCollection _views = []; private readonly AccountManager _accountManager; public string SaveManagerHeading => LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.SaveManagerHeading, _accountManager.LastOpenedUser.Name, _accountManager.LastOpenedUser.UserId); diff --git a/src/Ryujinx/UI/ViewModels/XCITrimmerViewModel.cs b/src/Ryujinx/UI/ViewModels/XCITrimmerViewModel.cs index 71af95bdc..43d3c631c 100644 --- a/src/Ryujinx/UI/ViewModels/XCITrimmerViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/XCITrimmerViewModel.cs @@ -35,9 +35,9 @@ namespace Ryujinx.Ava.UI.ViewModels private readonly Ryujinx.Common.Logging.XCIFileTrimmerLog _logger; private readonly ApplicationLibrary _applicationLibrary; private Optional _processingApplication = null; - private AvaloniaList _allXCIFiles = new(); - private AvaloniaList _selectedXCIFiles = new(); - private AvaloniaList _displayedXCIFiles = new(); + private AvaloniaList _allXCIFiles = []; + private AvaloniaList _selectedXCIFiles = []; + private AvaloniaList _displayedXCIFiles = []; private MainWindowViewModel _mainWindowViewModel; private CancellationTokenSource _cancellationTokenSource; private string _search; @@ -538,4 +538,4 @@ namespace Ryujinx.Ava.UI.ViewModels } } } -} \ No newline at end of file +} diff --git a/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs index d903d409f..31f12af8c 100644 --- a/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs +++ b/src/Ryujinx/UI/Views/Main/MainMenuBarView.axaml.cs @@ -38,7 +38,7 @@ namespace Ryujinx.Ava.UI.Views.Main private CheckBox[] GenerateToggleFileTypeItems() { - List checkBoxes = new(); + List checkBoxes = []; foreach (var item in Enum.GetValues(typeof(FileTypes))) { @@ -56,7 +56,7 @@ namespace Ryujinx.Ava.UI.Views.Main private static MenuItem[] GenerateLanguageMenuItems() { - List menuItems = new(); + List menuItems = []; string localePath = "Ryujinx/Assets/Locales"; string localeExt = ".json"; diff --git a/src/Spv.Generator/Module.cs b/src/Spv.Generator/Module.cs index fdcd62752..ce11f13de 100644 --- a/src/Spv.Generator/Module.cs +++ b/src/Spv.Generator/Module.cs @@ -46,21 +46,21 @@ namespace Spv.Generator { _version = version; _bound = 1; - _capabilities = new List(); - _extensions = new List(); + _capabilities = []; + _extensions = []; _extInstImports = new Dictionary(); _addressingModel = AddressingModel.Logical; _memoryModel = MemoryModel.Simple; - _entrypoints = new List(); - _executionModes = new List(); - _debug = new List(); - _annotations = new List(); + _entrypoints = []; + _executionModes = []; + _debug = []; + _annotations = []; _typeDeclarations = new Dictionary(); - _typeDeclarationsList = new List(); + _typeDeclarationsList = []; _constants = new Dictionary(); - _globals = new List(); - _functionsDeclarations = new List(); - _functionsDefinitions = new List(); + _globals = []; + _functionsDeclarations = []; + _functionsDefinitions = []; _instPool = instPool ?? new GeneratorPool(); _integerPool = integerPool ?? new GeneratorPool();