perf: Reducing boxing

This commit is contained in:
Chris Cameron
2018-07-26 12:56:01 -04:00
parent 8f17d59694
commit 6a979f5c12

View File

@@ -458,7 +458,9 @@ namespace ICD.Common.Utils
if (!IsEnum(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>