Prefer using collection expressions with implicit object creation when the type is clear

This commit is contained in:
Marco Carvalho
2024-12-27 13:23:31 -03:00
parent 850df38f1e
commit 57d1486da9
510 changed files with 6022 additions and 6212 deletions

View File

@@ -86,11 +86,11 @@ namespace Ryujinx.HLE.HOS
public ModCache()
{
RomfsContainers = new List<Mod<FileInfo>>();
ExefsContainers = new List<Mod<FileInfo>>();
RomfsDirs = new List<Mod<DirectoryInfo>>();
ExefsDirs = new List<Mod<DirectoryInfo>>();
Cheats = new List<Cheat>();
RomfsContainers = [];
ExefsContainers = [];
RomfsDirs = [];
ExefsDirs = [];
Cheats = [];
}
}
@@ -105,9 +105,9 @@ namespace Ryujinx.HLE.HOS
public PatchCache()
{
NsoPatches = new List<Mod<DirectoryInfo>>();
NroPatches = new List<Mod<DirectoryInfo>>();
KipPatches = new List<Mod<DirectoryInfo>>();
NsoPatches = [];
NroPatches = [];
KipPatches = [];
Initialized = false;
}
@@ -126,7 +126,7 @@ namespace Ryujinx.HLE.HOS
public ModLoader()
{
_appMods = new Dictionary<ulong, ModCache>();
_appMods = [];
_patches = new PatchCache();
}
@@ -356,7 +356,7 @@ namespace Ryujinx.HLE.HOS
private static IEnumerable<Cheat> GetCheatsInFile(FileInfo cheatFile)
{
string cheatName = DefaultCheatName;
List<string> instructions = new();
List<string> instructions = [];
using StreamReader cheatData = cheatFile.OpenText();
while (cheatData.ReadLine() is { } line)
@@ -383,7 +383,7 @@ namespace Ryujinx.HLE.HOS
// Start a new cheat section.
cheatName = line[1..^1];
instructions = new List<string>();
instructions = [];
}
else if (line.Length > 0)
{
@@ -752,7 +752,7 @@ namespace Ryujinx.HLE.HOS
patches[i] = new MemPatch();
}
var buildIds = new List<string>(programs.Length);
List<string> buildIds = new (programs.Length);
foreach (IExecutable p in programs)
{