misc: chore: Use collection expressions

This commit is contained in:
KeatonTheBot
2025-03-06 20:46:29 -06:00
parent 4d5757417e
commit e2973a875a
236 changed files with 9843 additions and 7561 deletions
+12 -12
View File
@@ -88,11 +88,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 = [];
}
}
@@ -107,9 +107,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;
}
@@ -373,8 +373,8 @@ namespace Ryujinx.HLE.HOS
private static IEnumerable<Cheat> GetCheatsInFile(FileInfo cheatFile)
{
string cheatName = DefaultCheatName;
List<string> instructions = new();
List<Cheat> cheats = new();
List<string> instructions = [];
List<Cheat> cheats = [];
using StreamReader cheatData = cheatFile.OpenText();
while (cheatData.ReadLine() is { } line)
@@ -401,7 +401,7 @@ namespace Ryujinx.HLE.HOS
// Start a new cheat section.
cheatName = line[1..^1];
instructions = new List<string>();
instructions = [];
}
else if (line.Length > 0)
{
@@ -434,7 +434,7 @@ namespace Ryujinx.HLE.HOS
{
foreach ((ulong applicationId, ModCache cache) in modCaches)
{
QueryContentsDir(cache, searchDir, applicationId, Array.Empty<ulong>());
QueryContentsDir(cache, searchDir, applicationId, []);
}
return true;