misc: chore: Use collection expressions in HLE project

This commit is contained in:
Evan Husted
2025-01-26 15:43:02 -06:00
parent 3c2f283ec7
commit 70b767ef60
72 changed files with 312 additions and 299 deletions

View File

@ -87,11 +87,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 = [];
}
}
@ -106,9 +106,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;
}
@ -357,7 +357,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)
@ -384,7 +384,7 @@ namespace Ryujinx.HLE.HOS
// Start a new cheat section.
cheatName = line[1..^1];
instructions = new List<string>();
instructions = [];
}
else if (line.Length > 0)
{
@ -470,7 +470,7 @@ namespace Ryujinx.HLE.HOS
return baseStorage;
}
HashSet<string> fileSet = new();
HashSet<string> fileSet = [];
RomFsBuilder builder = new();
int count = 0;