Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-carvalho committed Dec 27, 2024
1 parent 33b7184 commit 8a1b73a
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/ARMeilleure/Translation/ControlFlowGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void Update()
{
RemoveUnreachableBlocks(Blocks);

var visited = new HashSet<BasicBlock>();
HashSet<BasicBlock> visited = [];
var blockStack = new Stack<BasicBlock>();

Array.Resize(ref _postOrderBlocks, Blocks.Count);
Expand Down Expand Up @@ -88,7 +88,7 @@ public void Update()

private void RemoveUnreachableBlocks(IntrusiveList<BasicBlock> blocks)
{
var visited = new HashSet<BasicBlock>();
HashSet<BasicBlock> visited = [];
var workQueue = new Queue<BasicBlock>();

visited.Add(Entry);
Expand Down
8 changes: 4 additions & 4 deletions src/ARMeilleure/Translation/TranslatorStubs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private nint GenerateDispatchStub()

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>();

Expand All @@ -212,7 +212,7 @@ private nint GenerateSlowDispatchStub()

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>();

Expand Down Expand Up @@ -281,7 +281,7 @@ private DispatcherFunction GenerateDispatchLoop()

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>();
}
Expand All @@ -305,7 +305,7 @@ private WrapperFunction GenerateContextWrapper()

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>();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx.Common/Logging/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public static void Shutdown()

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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx.Graphics.Shader/CodeGen/Spirv/Instructions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ SpvInstruction AssembleOffsetVector(int count)
image = context.Image(declaration.ImageType, image);
}

var operands = operandsList.ToArray();
SpvInstruction[] operands = [.. operandsList];

SpvInstruction result;

Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx.Graphics.Vulkan/HelperShader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ public unsafe void ConvertIndexBuffer(VulkanRenderer gd,
bufferCopy.Add(new BufferCopy((ulong)(srcOffset + sequenceStart * indexSize), (ulong)outputOffset, (ulong)(indexSize * sequenceLength)));
}

var bufferCopyArray = bufferCopy.ToArray();
BufferCopy[] bufferCopyArray = [.. bufferCopy];

BufferHolder.InsertBufferBarrier(
gd,
Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx.HLE/HOS/ModLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ internal IStorage ApplyRomFsMods(ulong applicationId, IStorage baseStorage)
return baseStorage;
}

var fileSet = new HashSet<string>();
HashSet<string> fileSet = [];
var builder = new RomFsBuilder();
int count = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected static Result ProcessMessageImpl(ref ServiceDispatchContext context, R
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))
{
Expand Down
4 changes: 2 additions & 2 deletions src/Ryujinx.UI.Common/App/ApplicationLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -962,8 +962,8 @@ public int AutoLoadTitleUpdates(List<string> appDirs, out int numUpdatesRemoved)

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");
Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ private static void PrintSystemInfo()
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>"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void Sort()

// 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);
Expand Down
6 changes: 3 additions & 3 deletions src/Ryujinx/UI/ViewModels/XCITrimmerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ private void PerformOperation(ProcessingMode processingMode)

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(() =>
{
Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx/UI/Views/User/UserSaveManagerView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private void NavigatedTo(NavigationEventArgs arg)
public void LoadSaves()
{
ViewModel.Saves.Clear();
var saves = new ObservableCollection<SaveModel>();
ObservableCollection<SaveModel> saves = [];
var saveDataFilter = SaveDataFilter.Make(
programId: default,
saveType: SaveDataType.Account,
Expand Down

0 comments on commit 8a1b73a

Please sign in to comment.