This commit is contained in:
Marco Carvalho 2024-12-27 14:50:33 -03:00
parent 82cae0455a
commit 72fb248960
12 changed files with 19 additions and 19 deletions

View File

@ -47,7 +47,7 @@ namespace ARMeilleure.Translation
{ {
RemoveUnreachableBlocks(Blocks); RemoveUnreachableBlocks(Blocks);
var visited = new HashSet<BasicBlock>(); HashSet<BasicBlock> visited = [];
var blockStack = new Stack<BasicBlock>(); var blockStack = new Stack<BasicBlock>();
Array.Resize(ref _postOrderBlocks, Blocks.Count); Array.Resize(ref _postOrderBlocks, Blocks.Count);
@ -88,7 +88,7 @@ namespace ARMeilleure.Translation
private void RemoveUnreachableBlocks(IntrusiveList<BasicBlock> blocks) private void RemoveUnreachableBlocks(IntrusiveList<BasicBlock> blocks)
{ {
var visited = new HashSet<BasicBlock>(); HashSet<BasicBlock> visited = [];
var workQueue = new Queue<BasicBlock>(); var workQueue = new Queue<BasicBlock>();
visited.Add(Entry); visited.Add(Entry);

View File

@ -187,7 +187,7 @@ namespace ARMeilleure.Translation
var cfg = context.GetControlFlowGraph(); var cfg = context.GetControlFlowGraph();
var retType = OperandType.I64; 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<GuestFunction>(); var func = Compiler.Compile(cfg, argTypes, retType, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<GuestFunction>();
@ -212,7 +212,7 @@ namespace ARMeilleure.Translation
var cfg = context.GetControlFlowGraph(); var cfg = context.GetControlFlowGraph();
var retType = OperandType.I64; 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<GuestFunction>(); var func = Compiler.Compile(cfg, argTypes, retType, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<GuestFunction>();
@ -281,7 +281,7 @@ namespace ARMeilleure.Translation
var cfg = context.GetControlFlowGraph(); var cfg = context.GetControlFlowGraph();
var retType = OperandType.None; 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<DispatcherFunction>(); return Compiler.Compile(cfg, argTypes, retType, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<DispatcherFunction>();
} }
@ -305,7 +305,7 @@ namespace ARMeilleure.Translation
var cfg = context.GetControlFlowGraph(); var cfg = context.GetControlFlowGraph();
var retType = OperandType.I64; 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<WrapperFunction>(); return Compiler.Compile(cfg, argTypes, retType, CompilerOptions.HighCq, RuntimeInformation.ProcessArchitecture).Map<WrapperFunction>();
} }

View File

@ -203,7 +203,7 @@ namespace Ryujinx.Common.Logging
public static IReadOnlyCollection<LogLevel> GetEnabledLevels() public static IReadOnlyCollection<LogLevel> GetEnabledLevels()
{ {
var logs = new[] { Debug, Info, Warning, Error, Guest, AccessLog, Stub, Trace }; Log?[] logs = [Debug, Info, Warning, Error, Guest, AccessLog, Stub, Trace];
List<LogLevel> levels = new(logs.Length); List<LogLevel> levels = new(logs.Length);
foreach (var log in logs) foreach (var log in logs)
{ {

View File

@ -1376,7 +1376,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
image = context.Image(declaration.ImageType, image); image = context.Image(declaration.ImageType, image);
} }
var operands = operandsList.ToArray(); SpvInstruction[] operands = [.. operandsList];
SpvInstruction result; SpvInstruction result;

View File

@ -946,7 +946,7 @@ namespace Ryujinx.Graphics.Vulkan
bufferCopy.Add(new BufferCopy((ulong)(srcOffset + sequenceStart * indexSize), (ulong)outputOffset, (ulong)(indexSize * sequenceLength))); bufferCopy.Add(new BufferCopy((ulong)(srcOffset + sequenceStart * indexSize), (ulong)outputOffset, (ulong)(indexSize * sequenceLength)));
} }
var bufferCopyArray = bufferCopy.ToArray(); BufferCopy[] bufferCopyArray = [.. bufferCopy];
BufferHolder.InsertBufferBarrier( BufferHolder.InsertBufferBarrier(
gd, gd,

View File

@ -469,7 +469,7 @@ namespace Ryujinx.HLE.HOS
return baseStorage; return baseStorage;
} }
var fileSet = new HashSet<string>(); HashSet<string> fileSet = [];
var builder = new RomFsBuilder(); var builder = new RomFsBuilder();
int count = 0; int count = 0;

View File

@ -35,7 +35,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif
ReadOnlySpan<byte> inMessageRawData = inRawData[Unsafe.SizeOf<CmifInHeader>()..]; ReadOnlySpan<byte> inMessageRawData = inRawData[Unsafe.SizeOf<CmifInHeader>()..];
uint commandId = inHeader.CommandId; uint commandId = inHeader.CommandId;
var outHeader = Span<CmifOutHeader>.Empty; Span<CmifOutHeader> outHeader = [];
if (!entries.TryGetValue((int)commandId, out var commandHandler)) if (!entries.TryGetValue((int)commandId, out var commandHandler))
{ {

View File

@ -231,7 +231,7 @@ namespace Ryujinx.Ava
Logger.Notice.Print(LogClass.Application, $"{RyujinxApp.FullAppName} Version: {Version}"); Logger.Notice.Print(LogClass.Application, $"{RyujinxApp.FullAppName} Version: {Version}");
SystemInfo.Gather().Print(); SystemInfo.Gather().Print();
var enabledLogLevels = Logger.GetEnabledLevels().ToArray(); LogLevel[] enabledLogLevels = [.. Logger.GetEnabledLevels()];
Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(enabledLogLevels.Length is 0 Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(enabledLogLevels.Length is 0
? "<None>" ? "<None>"

View File

@ -105,7 +105,7 @@ namespace Ryujinx.Ava.UI.ViewModels
// NOTE(jpr): this works around a bug where calling _views.Clear also clears SelectedDownloadableContents for // 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 // some reason. so we save the items here and add them back after
var items = SelectedDownloadableContents.ToArray(); DownloadableContentModel[] items = [.. SelectedDownloadableContents];
Views.Clear(); Views.Clear();
Views.AddRange(view); Views.AddRange(view);

View File

@ -160,13 +160,13 @@ namespace Ryujinx.Ava.UI.ViewModels
Thread XCIFileTrimThread = new(() => Thread XCIFileTrimThread = new(() =>
{ {
var toProcess = Sort(SelectedXCIFiles List<XCITrimmerFileModel> toProcess = [.. Sort(SelectedXCIFiles
.Where(xci => .Where(xci =>
(processingMode == ProcessingMode.Untrimming && xci.Untrimmable) || (processingMode == ProcessingMode.Untrimming && xci.Untrimmable) ||
(processingMode == ProcessingMode.Trimming && xci.Trimmable) (processingMode == ProcessingMode.Trimming && xci.Trimmable)
)).ToList(); ))];
var viewsSaved = DisplayedXCIFiles.ToList(); List<XCITrimmerFileModel> viewsSaved = [.. DisplayedXCIFiles];
Dispatcher.UIThread.Post(() => Dispatcher.UIThread.Post(() =>
{ {

View File

@ -67,7 +67,7 @@ namespace Ryujinx.Ava.UI.Views.User
public void LoadSaves() public void LoadSaves()
{ {
ViewModel.Saves.Clear(); ViewModel.Saves.Clear();
var saves = new ObservableCollection<SaveModel>(); ObservableCollection<SaveModel> saves = [];
var saveDataFilter = SaveDataFilter.Make( var saveDataFilter = SaveDataFilter.Make(
programId: default, programId: default,
saveType: SaveDataType.Account, saveType: SaveDataType.Account,

View File

@ -951,8 +951,8 @@ namespace Ryujinx.Ava.Utilities.AppLibrary
try try
{ {
var titleIdsToSave = new HashSet<ulong>(); HashSet<ulong> titleIdsToSave = [];
var titleIdsToRefresh = new HashSet<ulong>(); HashSet<ulong> titleIdsToRefresh = [];
// Remove any updates which can no longer be located on disk // Remove any updates which can no longer be located on disk
Logger.Notice.Print(LogClass.Application, $"Removing non-existing Title Updates"); Logger.Notice.Print(LogClass.Application, $"Removing non-existing Title Updates");