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

@ -39,10 +39,10 @@ namespace Ryujinx.HLE.HOS.Applets.Browser
if ((_commonArguments.AppletVersion >= 0x80000 && _shimKind == ShimKind.Web) || (_commonArguments.AppletVersion >= 0x30000 && _shimKind == ShimKind.Share))
{
List<BrowserOutput> result = new()
{
new BrowserOutput(BrowserOutputType.ExitReason, (uint)WebExitReason.ExitButton),
};
List<BrowserOutput> result =
[
new BrowserOutput(BrowserOutputType.ExitReason, (uint)WebExitReason.ExitButton)
];
_normalSession.Push(BuildResponseNew(result));
}

View file

@ -64,7 +64,7 @@ namespace Ryujinx.HLE.HOS.Applets.Browser
public static (ShimKind, List<BrowserArgument>) ParseArguments(ReadOnlySpan<byte> data)
{
List<BrowserArgument> browserArguments = new();
List<BrowserArgument> browserArguments = [];
WebArgHeader header = IApplet.ReadStruct<WebArgHeader>(data[..8]);

View file

@ -184,7 +184,7 @@ namespace Ryujinx.HLE.HOS.Applets.Error
string messageText = Encoding.ASCII.GetString(messageTextBuffer.TakeWhile(b => !b.Equals(0)).ToArray());
string detailsText = Encoding.ASCII.GetString(detailsTextBuffer.TakeWhile(b => !b.Equals(0)).ToArray());
List<string> buttons = new();
List<string> buttons = [];
// TODO: Handle the LanguageCode to return the translated "OK" and "Details".

View file

@ -122,13 +122,14 @@ namespace Ryujinx.HLE.HOS.Applets.SoftwareKeyboard
{
// Try a list of fonts in case any of them is not available in the system.
string[] availableFonts = {
string[] availableFonts =
[
uiThemeFontFamily,
"Liberation Sans",
"FreeSans",
"DejaVu Sans",
"Lucida Grande",
};
"Lucida Grande"
];
foreach (string fontFamily in availableFonts)
{