misc: chore: Use explicit types & fix object creation

This commit is contained in:
KeatonTheBot committed 2026-05-30 16:26:50 -05:00
1 parent 9d3fecf334
commit 76a123b81d
454 files changed
+3042 -2961

No files matched your search

+1 -1
View File
@@ -89,7 +89,7 @@ namespace Ryujinx.Ava.Input
return false;
}
AvaloniaKeyboardMappingHelper.TryGetAvaKey(key, out var nativeKey);
AvaloniaKeyboardMappingHelper.TryGetAvaKey(key, out AvaKey nativeKey);
return _pressedKeys.Contains(nativeKey);
}
@@ -151,14 +151,14 @@ namespace Ryujinx.Ava.Input
static AvaloniaKeyboardMappingHelper()
{
var inputKeys = Enum.GetValues<Key>();
Key[] inputKeys = Enum.GetValues<Key>();
// NOTE: Avalonia.Input.Key is not contiguous and quite large, so use a dictionary instead of an array.
_avaKeyMapping = new Dictionary<AvaKey, Key>();
foreach (var key in inputKeys)
foreach (Key key in inputKeys)
{
if (TryGetAvaKey(key, out var index))
if (TryGetAvaKey(key, out AvaKey index))
{
_avaKeyMapping[index] = key;
}