diff options
author | TSRBerry <20988865+TSRBerry@users.noreply.github.com> | 2023-06-26 03:55:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-26 01:55:25 +0000 |
commit | 2de78a2d55a1306761788570ab192897299c55d8 (patch) | |
tree | b7b66b94ca3107689806a7981a9bf8817480eab6 /src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs | |
parent | b29ded1d6009dc6a82a0aefd594eda21b5c2d814 (diff) |
[Ryujinx.Input.SDL2] Address dotnet-format issues (#5385)1.1.922
* dotnet format style --severity info
Some changes were manually reverted.
* dotnet format analyzers --serverity info
Some changes have been minimally adapted.
* Restore a few unused methods and variables
* Silence dotnet format IDE0052 warnings
* Address dotnet format CA1816 warnings
* Address or silence dotnet format CA1806 and a few CA1854 warnings
* Address most dotnet format whitespace warnings
* Add comments to disabled warnings
* Simplify properties and array initialization, Use const when possible, Remove trailing commas
* Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas"
This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e.
* dotnet format whitespace after rebase
* Add trailing commas, log errors instead of throwing and remove redundant code
Diffstat (limited to 'src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs')
-rw-r--r-- | src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs b/src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs index d4086a10..d0e793de 100644 --- a/src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs +++ b/src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs @@ -7,8 +7,8 @@ namespace Ryujinx.Input.SDL2 { public class SDL2GamepadDriver : IGamepadDriver { - private Dictionary<int, string> _gamepadsInstanceIdsMapping; - private List<string> _gamepadsIds; + private readonly Dictionary<int, string> _gamepadsInstanceIdsMapping; + private readonly List<string> _gamepadsIds; public ReadOnlySpan<string> GamepadsIds => _gamepadsIds.ToArray(); @@ -35,7 +35,7 @@ namespace Ryujinx.Input.SDL2 } } - private string GenerateGamepadId(int joystickIndex) + private static string GenerateGamepadId(int joystickIndex) { Guid guid = SDL_JoystickGetDeviceGUID(joystickIndex); @@ -44,10 +44,10 @@ namespace Ryujinx.Input.SDL2 return null; } - return joystickIndex + "-" + guid.ToString(); + return joystickIndex + "-" + guid; } - private int GetJoystickIndexByGamepadId(string id) + private static int GetJoystickIndexByGamepadId(string id) { string[] data = id.Split("-"); @@ -118,6 +118,7 @@ namespace Ryujinx.Input.SDL2 public void Dispose() { + GC.SuppressFinalize(this); Dispose(true); } |