Simplify enumeration

This commit is contained in:
Isaac Marovitz 2024-04-15 19:15:25 -04:00
parent f2fb9f313c
commit 43fb2753bc
No known key found for this signature in database
GPG key ID: 97250B2B09A132E1

View file

@ -63,12 +63,7 @@ namespace Ryujinx.Input.Assigner
{
IEnumerable<GamepadButtonInputId> pressedButtons = _detector.GetPressedButtons();
if (pressedButtons.Any())
{
return !_forStick ? new(pressedButtons.First()) : new(((StickInputId)pressedButtons.First()));
}
return null;
return !_forStick ? new(pressedButtons.FirstOrDefault()) : new((StickInputId)pressedButtons.FirstOrDefault());
}
private void CollectButtonStats()