comparer = Comparer<T>.Default;
}
+#if FEATURE_CORECLR
+ // Since QuickSort and IntrospectiveSort produce different sorting sequence for equal keys the upgrade
+ // to IntrospectiveSort was quirked. However since the phone builds always shipped with the new sort aka
+ // IntrospectiveSort and we would want to continue using this sort moving forward CoreCLR always uses the new sort.
+
+ IntrospectiveSort(keys, index, length, comparer);
+#else
if (BinaryCompatibility.TargetsAtLeast_Desktop_V4_5)
{
IntrospectiveSort(keys, index, length, comparer);
{
DepthLimitedQuickSort(keys, index, length + index - 1, comparer, IntrospectiveSortUtilities.QuickSortDepthThreshold);
}
+#endif
}
catch (IndexOutOfRangeException)
{
#else
if (comparer == null || comparer == Comparer<T>.Default) {
#endif
+
+#if FEATURE_CORECLR
+ // Since QuickSort and IntrospectiveSort produce different sorting sequence for equal keys the upgrade
+ // to IntrospectiveSort was quirked. However since the phone builds always shipped with the new sort aka
+ // IntrospectiveSort and we would want to continue using this sort moving forward CoreCLR always uses the new sort.
+
+ IntrospectiveSort(keys, index, length);
+#else
// call the faster version of our sort algorithm if the user doesn't provide a comparer
if (BinaryCompatibility.TargetsAtLeast_Desktop_V4_5)
{
{
DepthLimitedQuickSort(keys, index, length + index - 1, IntrospectiveSortUtilities.QuickSortDepthThreshold);
}
+#endif
}
else
{
+#if FEATURE_CORECLR
+ // Since QuickSort and IntrospectiveSort produce different sorting sequence for equal keys the upgrade
+ // to IntrospectiveSort was quirked. However since the phone builds always shipped with the new sort aka
+ // IntrospectiveSort and we would want to continue using this sort moving forward CoreCLR always uses the new sort.
+
+ ArraySortHelper<T>.IntrospectiveSort(keys, index, length, comparer);
+#else
if (BinaryCompatibility.TargetsAtLeast_Desktop_V4_5)
{
ArraySortHelper<T>.IntrospectiveSort(keys, index, length, comparer);
{
ArraySortHelper<T>.DepthLimitedQuickSort(keys, index, length + index - 1, comparer, IntrospectiveSortUtilities.QuickSortDepthThreshold);
}
+#endif
}
}
catch (IndexOutOfRangeException)
comparer = Comparer<TKey>.Default;
}
+#if FEATURE_CORECLR
+ // Since QuickSort and IntrospectiveSort produce different sorting sequence for equal keys the upgrade
+ // to IntrospectiveSort was quirked. However since the phone builds always shipped with the new sort aka
+ // IntrospectiveSort and we would want to continue using this sort moving forward CoreCLR always uses the new sort.
+
+ IntrospectiveSort(keys, values, index, length, comparer);
+#else
if (BinaryCompatibility.TargetsAtLeast_Desktop_V4_5)
{
IntrospectiveSort(keys, values, index, length, comparer);
{
DepthLimitedQuickSort(keys, values, index, length + index - 1, comparer, IntrospectiveSortUtilities.QuickSortDepthThreshold);
}
+#endif
}
catch (IndexOutOfRangeException)
{
{
if (comparer == null || comparer == Comparer<TKey>.Default)
{
+#if FEATURE_CORECLR
+ // Since QuickSort and IntrospectiveSort produce different sorting sequence for equal keys the upgrade
+ // to IntrospectiveSort was quirked. However since the phone builds always shipped with the new sort aka
+ // IntrospectiveSort and we would want to continue using this sort moving forward CoreCLR always uses the new sort.
+
+ IntrospectiveSort(keys, values, index, length);
+#else
// call the faster version of our sort algorithm if the user doesn't provide a comparer
if (BinaryCompatibility.TargetsAtLeast_Desktop_V4_5)
{
{
DepthLimitedQuickSort(keys, values, index, length + index - 1, IntrospectiveSortUtilities.QuickSortDepthThreshold);
}
+#endif
}
else
{
+#if FEATURE_CORECLR
+ // Since QuickSort and IntrospectiveSort produce different sorting sequence for equal keys the upgrade
+ // to IntrospectiveSort was quirked. However since the phone builds always shipped with the new sort aka
+ // IntrospectiveSort and we would want to continue using this sort moving forward CoreCLR always uses the new sort.
+
+ ArraySortHelper<TKey, TValue>.IntrospectiveSort(keys, values, index, length, comparer);
+#else
if (BinaryCompatibility.TargetsAtLeast_Desktop_V4_5)
{
ArraySortHelper<TKey, TValue>.IntrospectiveSort(keys, values, index, length, comparer);
{
ArraySortHelper<TKey, TValue>.DepthLimitedQuickSort(keys, values, index, length + index - 1, comparer, IntrospectiveSortUtilities.QuickSortDepthThreshold);
}
+#endif
}
}