mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-13 20:47:24 +00:00
perf: Reducing boxing operations in enum utils
This commit is contained in:
parent
b8225b7842
commit
591240d973
2 changed files with 19 additions and 44 deletions
|
|
@ -79,15 +79,6 @@ namespace ICD.Common.Utils.Tests
|
|||
|
||||
#region Values
|
||||
|
||||
[Test]
|
||||
public void GetUnderlyingValueTest()
|
||||
{
|
||||
Assert.AreEqual(0, EnumUtils.GetUnderlyingValue(eTestEnum.None));
|
||||
Assert.AreEqual(1, EnumUtils.GetUnderlyingValue(eTestEnum.A));
|
||||
Assert.AreEqual(2, EnumUtils.GetUnderlyingValue(eTestEnum.B));
|
||||
Assert.AreEqual(3, EnumUtils.GetUnderlyingValue(eTestEnum.C));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetValuesGenericTest()
|
||||
{
|
||||
|
|
@ -122,7 +113,7 @@ namespace ICD.Common.Utils.Tests
|
|||
[Test]
|
||||
public void GetValuesExceptNoneTest()
|
||||
{
|
||||
object[] values = EnumUtils.GetValuesExceptNone(typeof(eTestEnum)).ToArray();
|
||||
eTestEnum[] values = EnumUtils.GetValuesExceptNone(typeof(eTestEnum)).Cast<eTestEnum>().ToArray();
|
||||
|
||||
Assert.AreEqual(3, values.Length);
|
||||
Assert.IsFalse(values.Contains(eTestEnum.None));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue