From 03893c2669bf1c105b9367f454b70a13489ae7c0 Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Tue, 31 Jul 2018 14:41:29 -0400 Subject: [PATCH] refactor: Removing unused code --- ICD.Common.Utils.Tests/MathUtilsTest.cs | 12 ++---------- ICD.Common.Utils/MathUtils.cs | 24 ------------------------ 2 files changed, 2 insertions(+), 34 deletions(-) diff --git a/ICD.Common.Utils.Tests/MathUtilsTest.cs b/ICD.Common.Utils.Tests/MathUtilsTest.cs index ebdff00..52c1edd 100644 --- a/ICD.Common.Utils.Tests/MathUtilsTest.cs +++ b/ICD.Common.Utils.Tests/MathUtilsTest.cs @@ -36,18 +36,10 @@ namespace ICD.Common.Utils.Tests Assert.AreEqual(100, MathUtils.MapRange(0, 10, 0, 100, 10)); } - [UsedImplicitly] - [TestCase(-10000, 5)] - [TestCase(10000, 5)] - public void GetNumberOfDigitsTest(int number, int expected) - { - Assert.AreEqual(expected, MathUtils.GetNumberOfDigits(number)); - } - [Test, UsedImplicitly] public void GetRangesTest() { - IEnumerable values = new int[] { 1, 3, 5, 6, 7, 8, 9, 10, 12 }; + IEnumerable values = new [] { 1, 3, 5, 6, 7, 8, 9, 10, 12 }; int[][] ranges = MathUtils.GetRanges(values).ToArray(); Assert.AreEqual(4, ranges.Length); @@ -68,7 +60,7 @@ namespace ICD.Common.Utils.Tests [Test, UsedImplicitly] public void RoundToNearestTest() { - IEnumerable values = new int[] { 0, 15, 30, 45 }; + IEnumerable values = new [] { 0, 15, 30, 45 }; Assert.AreEqual(15, MathUtils.RoundToNearest(21, values)); } } diff --git a/ICD.Common.Utils/MathUtils.cs b/ICD.Common.Utils/MathUtils.cs index c22c26f..1f44412 100644 --- a/ICD.Common.Utils/MathUtils.cs +++ b/ICD.Common.Utils/MathUtils.cs @@ -137,30 +137,6 @@ namespace ICD.Common.Utils 0.0f, 1.0f, new TimeSpan(value.Ticks).TotalSeconds); } - /// - /// Gets the digit count for the given number. - /// - /// - /// - public static int GetNumberOfDigits(int number) - { - int output = number.ToString().Length; - if (number < 0) - output--; - - return output; - } - - /// - /// Gets the digit count for the given number. - /// - /// - /// - public static int GetNumberOfDigits(uint number) - { - return number.ToString().Length; - } - /// /// Takes a sequence of numbers: /// 1, 3, 5, 6, 7, 8, 9, 10, 12