From 72fb248960677e4d39a79a7e4baa3cd7309f6d29 Mon Sep 17 00:00:00 2001 From: Marco Carvalho Date: Fri, 27 Dec 2024 14:50:33 -0300 Subject: [PATCH] . --- src/ARMeilleure/Translation/ControlFlowGraph.cs | 4 ++-- src/ARMeilleure/Translation/TranslatorStubs.cs | 8 ++++---- src/Ryujinx.Common/Logging/Logger.cs | 2 +- src/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs | 2 +- src/Ryujinx.Graphics.Vulkan/HelperShader.cs | 2 +- src/Ryujinx.HLE/HOS/ModLoader.cs | 2 +- .../Sdk/Sf/Cmif/ServiceDispatchTableBase.cs | 2 +- src/Ryujinx/Program.cs | 2 +- .../UI/ViewModels/DownloadableContentManagerViewModel.cs | 2 +- src/Ryujinx/UI/ViewModels/XCITrimmerViewModel.cs | 6 +++--- src/Ryujinx/UI/Views/User/UserSaveManagerView.axaml.cs | 2 +- src/Ryujinx/Utilities/AppLibrary/ApplicationLibrary.cs | 4 ++-- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/ARMeilleure/Translation/ControlFlowGraph.cs b/src/ARMeilleure/Translation/ControlFlowGraph.cs index 45b092ec5..9974623ef 100644 --- a/src/ARMeilleure/Translation/ControlFlowGraph.cs +++ b/src/ARMeilleure/Translation/ControlFlowGraph.cs @@ -47,7 +47,7 @@ namespace ARMeilleure.Translation { RemoveUnreachableBlocks(Blocks); - var visited = new HashSet(); + HashSet visited = []; var blockStack = new Stack(); Array.Resize(ref _postOrderBlocks, Blocks.Count); @@ -88,7 +88,7 @@ namespace ARMeilleure.Translation private void RemoveUnreachableBlocks(IntrusiveList blocks) { - var visited = new HashSet(); + HashSet visited = []; var workQueue = new Queue(); visited.Add(Entry); diff --git a/src/ARMeilleure/Translation/TranslatorStubs.cs b/src/ARMeilleure/Translation/TranslatorStubs.cs index bd9aed8d4..16625b372 100644 --- a/src/ARMeilleure/Translation/TranslatorStubs.cs +++ b/src/ARMeilleure/Translation/TranslatorStubs.cs @@ -187,7 +187,7 @@ namespace ARMeilleure.Translation var cfg = context.GetControlFlowGraph(); var retType = OperandType.I64; - var argTypes = new[] { OperandType.I64 }; + OperandType[] argTypes = [OperandType.I64]; var func = Compiler.Compile(cfg, argTypes, retType, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map(); @@ -212,7 +212,7 @@ namespace ARMeilleure.Translation var cfg = context.GetControlFlowGraph(); var retType = OperandType.I64; - var argTypes = new[] { OperandType.I64 }; + OperandType[] argTypes = [OperandType.I64]; var func = Compiler.Compile(cfg, argTypes, retType, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map(); @@ -281,7 +281,7 @@ namespace ARMeilleure.Translation var cfg = context.GetControlFlowGraph(); var retType = OperandType.None; - var argTypes = new[] { OperandType.I64, OperandType.I64 }; + OperandType[] argTypes = [OperandType.I64, OperandType.I64]; return Compiler.Compile(cfg, argTypes, retType, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map(); } @@ -305,7 +305,7 @@ namespace ARMeilleure.Translation var cfg = context.GetControlFlowGraph(); var retType = OperandType.I64; - var argTypes = new[] { OperandType.I64, OperandType.I64 }; + OperandType[] argTypes = [OperandType.I64, OperandType.I64]; return Compiler.Compile(cfg, argTypes, retType, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map(); } diff --git a/src/Ryujinx.Common/Logging/Logger.cs b/src/Ryujinx.Common/Logging/Logger.cs index 90a4c8651..4a3c4fe66 100644 --- a/src/Ryujinx.Common/Logging/Logger.cs +++ b/src/Ryujinx.Common/Logging/Logger.cs @@ -203,7 +203,7 @@ namespace Ryujinx.Common.Logging public static IReadOnlyCollection GetEnabledLevels() { - var logs = new[] { Debug, Info, Warning, Error, Guest, AccessLog, Stub, Trace }; + Log?[] logs = [Debug, Info, Warning, Error, Guest, AccessLog, Stub, Trace]; List levels = new(logs.Length); foreach (var log in logs) { diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs index afaac5996..7972b8d76 100644 --- a/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs +++ b/src/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs @@ -1376,7 +1376,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv image = context.Image(declaration.ImageType, image); } - var operands = operandsList.ToArray(); + SpvInstruction[] operands = [.. operandsList]; SpvInstruction result; diff --git a/src/Ryujinx.Graphics.Vulkan/HelperShader.cs b/src/Ryujinx.Graphics.Vulkan/HelperShader.cs index 32ad78f80..8c69448a3 100644 --- a/src/Ryujinx.Graphics.Vulkan/HelperShader.cs +++ b/src/Ryujinx.Graphics.Vulkan/HelperShader.cs @@ -946,7 +946,7 @@ namespace Ryujinx.Graphics.Vulkan bufferCopy.Add(new BufferCopy((ulong)(srcOffset + sequenceStart * indexSize), (ulong)outputOffset, (ulong)(indexSize * sequenceLength))); } - var bufferCopyArray = bufferCopy.ToArray(); + BufferCopy[] bufferCopyArray = [.. bufferCopy]; BufferHolder.InsertBufferBarrier( gd, diff --git a/src/Ryujinx.HLE/HOS/ModLoader.cs b/src/Ryujinx.HLE/HOS/ModLoader.cs index bfe2af223..5a0d083cc 100644 --- a/src/Ryujinx.HLE/HOS/ModLoader.cs +++ b/src/Ryujinx.HLE/HOS/ModLoader.cs @@ -469,7 +469,7 @@ namespace Ryujinx.HLE.HOS return baseStorage; } - var fileSet = new HashSet(); + HashSet fileSet = []; var builder = new RomFsBuilder(); int count = 0; diff --git a/src/Ryujinx.Horizon/Sdk/Sf/Cmif/ServiceDispatchTableBase.cs b/src/Ryujinx.Horizon/Sdk/Sf/Cmif/ServiceDispatchTableBase.cs index 2625a4c3e..b4f8f14b7 100644 --- a/src/Ryujinx.Horizon/Sdk/Sf/Cmif/ServiceDispatchTableBase.cs +++ b/src/Ryujinx.Horizon/Sdk/Sf/Cmif/ServiceDispatchTableBase.cs @@ -35,7 +35,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif ReadOnlySpan inMessageRawData = inRawData[Unsafe.SizeOf()..]; uint commandId = inHeader.CommandId; - var outHeader = Span.Empty; + Span outHeader = []; if (!entries.TryGetValue((int)commandId, out var commandHandler)) { diff --git a/src/Ryujinx/Program.cs b/src/Ryujinx/Program.cs index 6f0f3e12e..17f7988ea 100644 --- a/src/Ryujinx/Program.cs +++ b/src/Ryujinx/Program.cs @@ -231,7 +231,7 @@ namespace Ryujinx.Ava Logger.Notice.Print(LogClass.Application, $"{RyujinxApp.FullAppName} Version: {Version}"); SystemInfo.Gather().Print(); - var enabledLogLevels = Logger.GetEnabledLevels().ToArray(); + LogLevel[] enabledLogLevels = [.. Logger.GetEnabledLevels()]; Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(enabledLogLevels.Length is 0 ? "" diff --git a/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs b/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs index 487d63609..b5b7aeb46 100644 --- a/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/DownloadableContentManagerViewModel.cs @@ -105,7 +105,7 @@ namespace Ryujinx.Ava.UI.ViewModels // NOTE(jpr): this works around a bug where calling _views.Clear also clears SelectedDownloadableContents for // some reason. so we save the items here and add them back after - var items = SelectedDownloadableContents.ToArray(); + DownloadableContentModel[] items = [.. SelectedDownloadableContents]; Views.Clear(); Views.AddRange(view); diff --git a/src/Ryujinx/UI/ViewModels/XCITrimmerViewModel.cs b/src/Ryujinx/UI/ViewModels/XCITrimmerViewModel.cs index 0cfed8882..26c686e3a 100644 --- a/src/Ryujinx/UI/ViewModels/XCITrimmerViewModel.cs +++ b/src/Ryujinx/UI/ViewModels/XCITrimmerViewModel.cs @@ -160,13 +160,13 @@ namespace Ryujinx.Ava.UI.ViewModels Thread XCIFileTrimThread = new(() => { - var toProcess = Sort(SelectedXCIFiles + List toProcess = [.. Sort(SelectedXCIFiles .Where(xci => (processingMode == ProcessingMode.Untrimming && xci.Untrimmable) || (processingMode == ProcessingMode.Trimming && xci.Trimmable) - )).ToList(); + ))]; - var viewsSaved = DisplayedXCIFiles.ToList(); + List viewsSaved = [.. DisplayedXCIFiles]; Dispatcher.UIThread.Post(() => { diff --git a/src/Ryujinx/UI/Views/User/UserSaveManagerView.axaml.cs b/src/Ryujinx/UI/Views/User/UserSaveManagerView.axaml.cs index 69986c014..dcbcc6216 100644 --- a/src/Ryujinx/UI/Views/User/UserSaveManagerView.axaml.cs +++ b/src/Ryujinx/UI/Views/User/UserSaveManagerView.axaml.cs @@ -67,7 +67,7 @@ namespace Ryujinx.Ava.UI.Views.User public void LoadSaves() { ViewModel.Saves.Clear(); - var saves = new ObservableCollection(); + ObservableCollection saves = []; var saveDataFilter = SaveDataFilter.Make( programId: default, saveType: SaveDataType.Account, diff --git a/src/Ryujinx/Utilities/AppLibrary/ApplicationLibrary.cs b/src/Ryujinx/Utilities/AppLibrary/ApplicationLibrary.cs index 57cef8702..5819123c2 100644 --- a/src/Ryujinx/Utilities/AppLibrary/ApplicationLibrary.cs +++ b/src/Ryujinx/Utilities/AppLibrary/ApplicationLibrary.cs @@ -951,8 +951,8 @@ namespace Ryujinx.Ava.Utilities.AppLibrary try { - var titleIdsToSave = new HashSet(); - var titleIdsToRefresh = new HashSet(); + HashSet titleIdsToSave = []; + HashSet titleIdsToRefresh = []; // Remove any updates which can no longer be located on disk Logger.Notice.Print(LogClass.Application, $"Removing non-existing Title Updates");