From a859c4096c8bf8c7a493324093b937bbc24fa053 Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Tue, 8 Aug 2017 11:35:35 -0400 Subject: [PATCH] Fixing extension method gunk --- ICD.Common.Utils/EnumUtils.cs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/ICD.Common.Utils/EnumUtils.cs b/ICD.Common.Utils/EnumUtils.cs index f7f4703..5512985 100644 --- a/ICD.Common.Utils/EnumUtils.cs +++ b/ICD.Common.Utils/EnumUtils.cs @@ -342,27 +342,28 @@ namespace ICD.Common.Utils return ((value & (value - 1)) != 0); } - /// - /// Returns true if this enum contains any flags. - /// - /// - /// - [PublicAPI] - public static bool HasAnyFlags(this T extends) + /// + /// Returns true if the enum contains any flags. + /// + /// + /// + [PublicAPI] + public static bool HasAnyFlags(T value) { - return GetFlagsExceptNone(extends).Any(); + return GetFlagsExceptNone(value).Any(); } /// - /// Returns true if this enum contains any of the given flag values. + /// Returns true if the enum contains any of the given flag values. /// - /// /// + /// /// [PublicAPI] - public static bool HasAnyFlags(this T extends, T value) + public static bool HasAnyFlags(T value, T other) { - return GetFlagsIntersection(extends, value).HasAnyFlags(); + T intersection = GetFlagsIntersection(value, other); + return HasAnyFlags(intersection); } #endregion