mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 13:15:07 +00:00
perf: Reducing boxing
This commit is contained in:
@@ -458,7 +458,9 @@ namespace ICD.Common.Utils
|
|||||||
if (!IsEnum(value))
|
if (!IsEnum(value))
|
||||||
throw new ArgumentException(string.Format("{0} is not an enum", value.GetType().Name), "value");
|
throw new ArgumentException(string.Format("{0} is not an enum", value.GetType().Name), "value");
|
||||||
|
|
||||||
return HasAnyFlags(value) && !HasMultipleFlags(value);
|
int numeric = (int)(object)value;
|
||||||
|
|
||||||
|
return HasAnyFlags(numeric) && !HasMultipleFlags(numeric);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user