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

View File

@ -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<GuestFunction>();
@ -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<GuestFunction>();
@ -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<DispatcherFunction>();
}
@ -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<WrapperFunction>();
}

View File

@ -203,7 +203,7 @@ namespace Ryujinx.Common.Logging
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);
foreach (var log in logs)
{

View File

@ -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;

View File

@ -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,

View File

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

View File

@ -35,7 +35,7 @@ namespace Ryujinx.Horizon.Sdk.Sf.Cmif
ReadOnlySpan<byte> inMessageRawData = inRawData[Unsafe.SizeOf<CmifInHeader>()..];
uint commandId = inHeader.CommandId;
var outHeader = Span<CmifOutHeader>.Empty;
Span<CmifOutHeader> outHeader = [];
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}");
SystemInfo.Gather().Print();
var enabledLogLevels = Logger.GetEnabledLevels().ToArray();
LogLevel[] enabledLogLevels = [.. Logger.GetEnabledLevels()];
Logger.Notice.Print(LogClass.Application, $"Logs Enabled: {(enabledLogLevels.Length is 0
? "<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
// 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);

View File

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

View File

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

View File

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