EnumHelper.split_flags requires all bits to match and be non-zero

This commit is contained in:
John Colvin committed 2019-08-27 13:10:36 -04:00
1 parent 76cc77485a
commit 8ef97d012a
1 file changed
+2 -1
+2 -1
View File
@@ -79,7 +79,8 @@ namespace mbts.ui.utility {
long lflags = Convert.ToInt64(flags);
foreach (TEnum e in get_values<TEnum>()) {
long lval = Convert.ToInt64(e);
if ((lval & lflags)!= 0)
long common_bits = lval & lflags;
if (common_bits != 0 && common_bits == lval)
yield return e;
}
}