mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
fix: Fixed a bug where EnumUtils.GetFlags, and overloads, would also return defined composites
This commit is contained in:
@@ -352,10 +352,11 @@ namespace ICD.Common.Utils
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<object> GetFlags(Type type, object value)
|
||||
{
|
||||
return s_EnumFlagsCacheSection.Execute(() => s_EnumFlagsCache.GetOrAddNew(type, () => new Dictionary<object, object[]>())
|
||||
.GetOrAddNew(value, () => GetValues(type)
|
||||
.Where(f => HasFlag(value, f))
|
||||
.ToArray()));
|
||||
return s_EnumFlagsCacheSection.Execute(() => s_EnumFlagsCache
|
||||
.GetOrAddNew(type, () => new Dictionary<object, object[]>())
|
||||
.GetOrAddNew(value, () => GetValues(type)
|
||||
.Where(f => !HasMultipleFlags((int)f) && HasFlag(value, f))
|
||||
.ToArray()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user