diff --git a/.editorconfig b/.editorconfig index 520a799f94..b0f0d10eb8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -177,7 +177,10 @@ dotnet_diagnostic.IDE0041.severity = warning # Make field readonly. dotnet_diagnostic.IDE0044.severity = warning -# Unused private member. +# Remove unused private member. +dotnet_diagnostic.IDE0051.severity = warning + +# Remove unread private member. dotnet_diagnostic.IDE0052.severity = warning # Unnecessary value assignment. diff --git a/OpenRA.Game/Graphics/Viewport.cs b/OpenRA.Game/Graphics/Viewport.cs index a797ea36c4..3dc5d55aa8 100644 --- a/OpenRA.Game/Graphics/Viewport.cs +++ b/OpenRA.Game/Graphics/Viewport.cs @@ -121,23 +121,6 @@ namespace OpenRA.Graphics public static long LastMoveRunTime = 0; public static int2 LastMousePos; - float ClosestTo(float[] collection, float target) - { - var closestValue = collection.First(); - var subtractResult = Math.Abs(closestValue - target); - - foreach (var element in collection) - { - if (Math.Abs(element - target) < subtractResult) - { - subtractResult = Math.Abs(element - target); - closestValue = element; - } - } - - return closestValue; - } - public ScrollDirection GetBlockedDirections() { var ret = ScrollDirection.None; diff --git a/OpenRA.Test/OpenRA.Game/VariableExpressionTest.cs b/OpenRA.Test/OpenRA.Game/VariableExpressionTest.cs index 3c6d03026d..06f778e998 100644 --- a/OpenRA.Test/OpenRA.Game/VariableExpressionTest.cs +++ b/OpenRA.Test/OpenRA.Game/VariableExpressionTest.cs @@ -42,11 +42,6 @@ namespace OpenRA.Test Assert.AreEqual(value, new IntegerExpression(expression).Evaluate(testValues), expression); } - void AssertParseFailure(string expression) - { - Assert.Throws(typeof(InvalidDataException), () => new IntegerExpression(expression).Evaluate(testValues), expression); - } - void AssertParseFailure(string expression, string errorMessage) { var actualErrorMessage = Assert.Throws(typeof(InvalidDataException),