From d1dc6293e8c29bffc2fbe0f6e19d0175ac2fd4d2 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Sat, 18 Mar 2023 12:04:38 +0000 Subject: [PATCH] Fix RCS1049 --- .editorconfig | 3 +++ OpenRA.Mods.Cnc/UtilityCommands/Glob.cs | 2 +- OpenRA.Mods.Common/Traits/Player/TechTree.cs | 2 +- OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.editorconfig b/.editorconfig index c52f82d2c4..f4eea3711f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -971,6 +971,9 @@ dotnet_diagnostic.RCS1043.severity = warning # Use lambda expression instead of anonymous method. dotnet_diagnostic.RCS1048.severity = warning +# Simplify boolean comparison. +dotnet_diagnostic.RCS1049.severity = warning + # Avoid locking on publicly accessible instance. dotnet_diagnostic.RCS1059.severity = warning diff --git a/OpenRA.Mods.Cnc/UtilityCommands/Glob.cs b/OpenRA.Mods.Cnc/UtilityCommands/Glob.cs index 79821d2d5c..652da65ec6 100644 --- a/OpenRA.Mods.Cnc/UtilityCommands/Glob.cs +++ b/OpenRA.Mods.Cnc/UtilityCommands/Glob.cs @@ -65,7 +65,7 @@ namespace OpenRA.Mods.Cnc.UtilityCommands if (parts.Count == 0 || (parts[0][0] != Path.DirectorySeparatorChar && parts[0][0] != Path.AltDirectorySeparatorChar - && parts[0].Contains(':') == false + && !parts[0].Contains(':') && parts[0] != "." + Path.DirectorySeparatorChar && parts[0] != "." + Path.AltDirectorySeparatorChar && parts[0] != ".." + Path.DirectorySeparatorChar diff --git a/OpenRA.Mods.Common/Traits/Player/TechTree.cs b/OpenRA.Mods.Common/Traits/Player/TechTree.cs index facb3a57b8..c5b6ab3c1d 100644 --- a/OpenRA.Mods.Common/Traits/Player/TechTree.cs +++ b/OpenRA.Mods.Common/Traits/Player/TechTree.cs @@ -171,7 +171,7 @@ namespace OpenRA.Mods.Common.Traits var nowHasPrerequisites = !hasReachedLimit && HasPrerequisites(ownedPrerequisites); var nowHidden = IsHidden(ownedPrerequisites); - if (initialized == false) + if (!initialized) { initialized = true; hasPrerequisites = !nowHasPrerequisites; diff --git a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs index 7284d49a4e..2a8bc347f4 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ReplayBrowserLogic.cs @@ -688,7 +688,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic foreach (var replay in replays) replayState[replay].Visible = EvaluateReplayVisibility(replay); - if (selectedReplay == null || replayState[selectedReplay].Visible == false) + if (selectedReplay == null || !replayState[selectedReplay].Visible) SelectFirstVisibleReplay(); replayList.Layout.AdjustChildren();