Skip to content

Commit

Permalink
Revert "? true : false" removal (#70631)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo authored Jun 13, 2022
1 parent 4f81257 commit a103efd
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ private static bool LessThan(ref T left, ref T right)
if (typeof(T) == typeof(float)) return (float)(object)left < (float)(object)right;
if (typeof(T) == typeof(double)) return (double)(object)left < (double)(object)right;
if (typeof(T) == typeof(Half)) return (Half)(object)left < (Half)(object)right;
return left.CompareTo(right) < 0;
return left.CompareTo(right) < 0 ? true : false;
}

[MethodImpl(MethodImplOptions.AggressiveInlining)] // compiles to a single comparison or method call
Expand All @@ -595,7 +595,7 @@ private static bool GreaterThan(ref T left, ref T right)
if (typeof(T) == typeof(float)) return (float)(object)left > (float)(object)right;
if (typeof(T) == typeof(double)) return (double)(object)left > (double)(object)right;
if (typeof(T) == typeof(Half)) return (Half)(object)left > (Half)(object)right;
return left.CompareTo(right) > 0;
return left.CompareTo(right) > 0 ? true : false;
}
}

Expand Down

0 comments on commit a103efd

Please sign in to comment.