Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
costin-zaharia-sonarsource committed Oct 18, 2023
1 parent edf475a commit a0be94b
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ protected override void Initialize(SonarAnalysisContext context) =>
uint x => (BigInteger)x,
long x => (BigInteger)x,
ulong x => (BigInteger)x,
// this is a safeguard for the case when the enum is defined with a base type that is not currently supported by the compiler
var x when BigInteger.TryParse(x.ToString(), out var value) => value,
_ => null
}
: null;
Expand All @@ -91,9 +89,7 @@ private static bool IsValidFlagValue(BigInteger? enumValue, IEnumerable<BigInteg

private static bool IsZeroOrPowerOfTwo(BigInteger value) =>
value.IsZero
|| (value.Sign == -1
? BigInteger.Multiply(value, -1).IsPowerOfTwo
: value.IsPowerOfTwo);
|| BigInteger.Abs(value).IsPowerOfTwo;

private static bool IsCombinationOfOtherValues(BigInteger value, IEnumerable<BigInteger> otherValues)
{
Expand Down

0 comments on commit a0be94b

Please sign in to comment.