From 71e08e27b91c40fa3a5fff0ce6c639e95675a1b4 Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Thu, 8 Jun 2023 19:48:57 +0200 Subject: [PATCH] bump AnalysisModePerformance to Recommended fixes CA1841 silence CA1805 and CA1822 because of sheer amount of violations reduce severity of CA1838 because I don't wanna fix it lol --- .editorconfig | 7 +++++++ Common.props | 1 + .../ReflectionCacheGenerator.cs | 2 +- References/BizHawk.SrcGen.ReflectionCache.dll | Bin 13312 -> 13312 bytes .../config/ControllerConfig.cs | 2 +- .../SaveController.cs | 2 +- 6 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.editorconfig b/.editorconfig index d3c69da1dd..36f16df505 100644 --- a/.editorconfig +++ b/.editorconfig @@ -17,3 +17,10 @@ dotnet_code_quality.CA1305.excluded_symbol_names = T:System.Byte|T:System.SByte| dotnet_diagnostic.CA1305.severity = error dotnet_diagnostic.CA2101.severity = suggestion + +# Performance rules +dotnet_code_quality.CA1826.exclude_ordefault_methods = true + +dotnet_diagnostic.CA1805.severity = silent +dotnet_diagnostic.CA1822.severity = silent +dotnet_diagnostic.CA1838.severity = suggestion diff --git a/Common.props b/Common.props index 2e6de05914..c2acdab16f 100644 --- a/Common.props +++ b/Common.props @@ -4,6 +4,7 @@ Recommended Recommended Recommended + Recommended $(MSBuildProjectDirectory)/../../Common.ruleset true true diff --git a/ExternalProjects/BizHawk.SrcGen.ReflectionCache/ReflectionCacheGenerator.cs b/ExternalProjects/BizHawk.SrcGen.ReflectionCache/ReflectionCacheGenerator.cs index 4d01976c53..b1f363e4f3 100644 --- a/ExternalProjects/BizHawk.SrcGen.ReflectionCache/ReflectionCacheGenerator.cs +++ b/ExternalProjects/BizHawk.SrcGen.ReflectionCache/ReflectionCacheGenerator.cs @@ -77,7 +77,7 @@ namespace {nSpace} {{ private const string EMBED_PREFIX = ""{nSpace}.""; - private static Type[]? _types = null; + private static Type[]? _types; private static readonly Assembly Asm = typeof({nSpace}.ReflectionCache).Assembly; diff --git a/References/BizHawk.SrcGen.ReflectionCache.dll b/References/BizHawk.SrcGen.ReflectionCache.dll index 5d35562ca211e08a231732eef532cc870faef319..6c08fb3ce8876bddbff998a1e7fd64a4dc11d67b 100644 GIT binary patch delta 311 zcmZq3Xvmn*!E#`^<>HAwGK_i?SB5j*p3KOo&icZWfgxnFB9qSKNJe!=lgW*Y^^E+J z8JUDxKd3M;FisBCHQyY-l*h==$IMW$NJE~1fs2Qqv50;1S>`W{jJlH#u^wc!pWMQ> zL&}AVfk8PmnBj>61A_nqknJAo=>nv`C~OX6Um(GZg`IRm3_025Gq1rXbK0r6x(9dXtzK-QMY zx;n}N^OBFRyu>!kYrVZpaM_l#mXi~7vW=jET=`HzkU>6cUrgJ%d*R#twqfg;y@94d mfh>rvFi}wq=wA`tUy~ge1vc~P{bFV^u-+_a^qz5|0XqQEdS18y delta 323 zcmZq3Xvmn*!NRIMwP|9H45Qt|mEnx9Co?jtv;Od8UtMl=9>eU@)-GLm>CKdX~;7$aPjan7Kv^?%lw6r(R%VB)`N_`lUvw! zNQH1QFerxxGkj5CU=UycvfV>HU4S%;;^r{+1rjWK^%#^U+bL*Ho}kDxSzkebSAoHn zL4hHUp_CzqA!oCl!aQ~%28P#5?%lm8t>?Ay=;1!eMH3hozforq^;-1lH3Oq>029!- z3Ly6J0^-SxI^wKHfUF~vWp$JVPP>=g4cM*jzd~c~{6in{m-KNYcrqTFJ>kO>&=2j?-?f=umb=hdSAQ% diff --git a/src/BizHawk.Client.EmuHawk/config/ControllerConfig.cs b/src/BizHawk.Client.EmuHawk/config/ControllerConfig.cs index 3f64cda681..50641fb9ec 100644 --- a/src/BizHawk.Client.EmuHawk/config/ControllerConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/ControllerConfig.cs @@ -114,7 +114,7 @@ namespace BizHawk.Client.EmuHawk // check to make sure that the settings object has all of the appropriate bool buttons foreach (var button in controllerButtons) { - if (!settings.Keys.Contains(button)) + if (!settings.ContainsKey(button)) { settings[button] = defaultValue; } diff --git a/src/BizHawk.Emulation.Common/SaveController.cs b/src/BizHawk.Emulation.Common/SaveController.cs index ff366e3c34..0c423b3df2 100644 --- a/src/BizHawk.Emulation.Common/SaveController.cs +++ b/src/BizHawk.Emulation.Common/SaveController.cs @@ -72,7 +72,7 @@ namespace BizHawk.Emulation.Common foreach (var k in Definition.Axes.Keys) { - if (_buttons.Keys.Contains(k)) + if (_buttons.ContainsKey(k)) { throw new Exception("name collision between bool and float lists!"); }