Skip to content

Commit a103efd

Browse files
authored
Revert "? true : false" removal (#70631)
1 parent 4f81257 commit a103efd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libraries/System.Private.CoreLib/src/System/Collections/Generic/ArraySortHelper.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ private static bool LessThan(ref T left, ref T right)
576576
if (typeof(T) == typeof(float)) return (float)(object)left < (float)(object)right;
577577
if (typeof(T) == typeof(double)) return (double)(object)left < (double)(object)right;
578578
if (typeof(T) == typeof(Half)) return (Half)(object)left < (Half)(object)right;
579-
return left.CompareTo(right) < 0;
579+
return left.CompareTo(right) < 0 ? true : false;
580580
}
581581

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

0 commit comments

Comments
 (0)