237 implementations of IComparer
Aspire.Dashboard (3)
CodeGenerator (1)
dotnet-svcutil-lib (6)
GenerateDocumentationAndConfigFiles (5)
Metrics (3)
Metrics.Legacy (3)
Microsoft.AspNetCore.Components (1)
Microsoft.AspNetCore.Components.Endpoints (1)
Microsoft.AspNetCore.Http.Extensions (1)
Microsoft.AspNetCore.Mvc.Core (1)
Microsoft.AspNetCore.Mvc.TagHelpers (1)
Microsoft.AspNetCore.OutputCaching (1)
Microsoft.AspNetCore.Razor.Runtime (1)
Microsoft.AspNetCore.ResponseCaching (1)
Microsoft.AspNetCore.Routing (6)
Microsoft.AspNetCore.Routing.Microbenchmarks (1)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
Microsoft.Cci.Extensions (3)
Microsoft.CodeAnalysis (6)
Microsoft.CodeAnalysis.Analyzers (5)
Microsoft.CodeAnalysis.AnalyzerUtilities (3)
Microsoft.CodeAnalysis.BannedApiAnalyzers (4)
Microsoft.CodeAnalysis.CodeStyle (2)
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.CSharp (9)
Microsoft.CodeAnalysis.CSharp.CodeStyle (4)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
Microsoft.CodeAnalysis.CSharp.Features (2)
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
Microsoft.CodeAnalysis.EditorFeatures (2)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (2)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (2)
Microsoft.CodeAnalysis.Features (5)
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (4)
Microsoft.CodeAnalysis.PublicApiAnalyzers (3)
Microsoft.CodeAnalysis.PublicApiAnalyzers.CodeFixes (1)
Microsoft.CodeAnalysis.ResxSourceGenerator (3)
Microsoft.CodeAnalysis.Test.Utilities (1)
Microsoft.CodeAnalysis.UnitTests (6)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.Workspaces (5)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Microsoft.DotNet.XUnitAssert.Tests (1)
Microsoft.Extensions.Configuration (1)
Microsoft.Extensions.Primitives (1)
Microsoft.Maui.Controls (2)
Microsoft.Maui.Graphics (1)
Microsoft.ML.Ensemble (2)
Microsoft.ML.FastTree (2)
Microsoft.ML.Sweeper (2)
Microsoft.ML.TimeSeries (1)
Microsoft.ML.Tokenizers (1)
Microsoft.ML.Tokenizers.Tests (1)
Microsoft.Net.Http.Headers (2)
Microsoft.VisualBasic.Core (1)
Microsoft.VisualStudio.LanguageServices (4)
PresentationCore (3)
PresentationFramework (7)
ReachFramework (1)
Roslyn.Diagnostics.Analyzers (4)
Roslyn.Diagnostics.CSharp.Analyzers (5)
System.ComponentModel.TypeConverter (2)
System.Configuration.ConfigurationManager (1)
System.Data.Common (1)
System.Formats.Asn1 (2)
System.Formats.Cbor (1)
System.Formats.Tar (1)
System.Linq.AsyncEnumerable (2)
System.Linq.Expressions (1)
System.Linq.Parallel (5)
System.Private.CoreLib (5)
System.Private.DataContractSerialization (2)
System.Private.Xml (7)
System.Private.Xml.Linq (1)
System.Reflection.Metadata (3)
System.Resources.Extensions (1)
System.Resources.Writer (1)
System.Windows.Controls.Ribbon (2)
System.Windows.Forms (14)
System.Windows.Forms.Design (9)
System.Xaml (2)
Test.Utilities (3)
Text.Analyzers (4)
xunit.assert (1)
1919 references to IComparer
dotnet-svcutil-lib (4)
GenerateDocumentationAndConfigFiles (75)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Metrics (66)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Metrics.Legacy (66)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Microsoft.AspNetCore.Components (1)
Microsoft.AspNetCore.Routing (16)
Microsoft.AspNetCore.Routing.Microbenchmarks (2)
Microsoft.AspNetCore.Routing.Tests (6)
Microsoft.Cci.Extensions (7)
Microsoft.CodeAnalysis (62)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Microsoft.CodeAnalysis.Analyzers (75)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Microsoft.CodeAnalysis.AnalyzerUtilities (66)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Microsoft.CodeAnalysis.BannedApiAnalyzers (74)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Microsoft.CodeAnalysis.CodeStyle (60)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Microsoft.CodeAnalysis.CodeStyle.Fixes (10)
Microsoft.CodeAnalysis.Collections.Package (60)
Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Microsoft.CodeAnalysis.CSharp (2)
Microsoft.CodeAnalysis.CSharp.CodeStyle (18)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.CSharp.Workspaces (21)
Microsoft.CodeAnalysis.Debugging.Package (3)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (4)
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (4)
Microsoft.CodeAnalysis.Extensions.Package (60)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Microsoft.CodeAnalysis.Features (4)
Microsoft.CodeAnalysis.InteractiveHost (60)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (74)
Microsoft.CodeAnalysis.PooledObjects.Package (3)
Microsoft.CodeAnalysis.PublicApiAnalyzers (66)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Microsoft.CodeAnalysis.ResxSourceGenerator (66)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Microsoft.CodeAnalysis.Threading.Package (60)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Microsoft.CodeAnalysis.UnitTests (28)
Collections\ImmutableListTestBase.cs (5)
66private protected abstract int BinarySearchImpl<T>(ImmutableSegmentedList<T> list, T item, IComparer<T>? comparer);
68private protected abstract int BinarySearchImpl<T>(ImmutableSegmentedList<T> list, int index, int count, T item, IComparer<T>? comparer);
422IComparer<int>? comparer = null;
535private protected abstract List<T> SortTestHelper<T>(ImmutableSegmentedList<T> list, IComparer<T>? comparer);
537private protected abstract List<T> SortTestHelper<T>(ImmutableSegmentedList<T> list, int index, int count, IComparer<T>? comparer);
Collections\ImmutableSegmentedListBuilderTest.cs (4)
512private protected override int BinarySearchImpl<T>(ImmutableSegmentedList<T> list, T item, IComparer<T>? comparer)
515private protected override int BinarySearchImpl<T>(ImmutableSegmentedList<T> list, int index, int count, T item, IComparer<T>? comparer)
532private protected override List<T> SortTestHelper<T>(ImmutableSegmentedList<T> list, IComparer<T>? comparer)
539private protected override List<T> SortTestHelper<T>(ImmutableSegmentedList<T> list, int index, int count, IComparer<T>? comparer)
Collections\ImmutableSegmentedListTest.cs (4)
866private protected override List<T> SortTestHelper<T>(ImmutableSegmentedList<T> list, IComparer<T>? comparer)
871private protected override List<T> SortTestHelper<T>(ImmutableSegmentedList<T> list, int index, int count, IComparer<T>? comparer)
937private protected override int BinarySearchImpl<T>(ImmutableSegmentedList<T> list, T item, IComparer<T>? comparer)
940private protected override int BinarySearchImpl<T>(ImmutableSegmentedList<T> list, int index, int count, T item, IComparer<T>? comparer)
Microsoft.CodeAnalysis.VisualBasic (1)
Microsoft.CodeAnalysis.Workspaces (73)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (62)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Microsoft.Data.Analysis (8)
Microsoft.DotNet.XliffTasks (2)
Microsoft.DotNet.XUnitAssert.Tests (1)
Microsoft.Maui.Controls (3)
Microsoft.ML.FastTree (1)
Microsoft.Net.Http.Headers (2)
Microsoft.VisualBasic.Core (1)
Microsoft.VisualStudio.LanguageServices (2)
mscorlib (1)
netstandard (1)
PresentationCore (7)
PresentationFramework (1)
ReachFramework (1)
Roslyn.Diagnostics.Analyzers (74)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Roslyn.Diagnostics.CSharp.Analyzers (21)
System.Collections (32)
System.Collections.Immutable (86)
System\Collections\Immutable\ImmutableList_1.cs (8)
77/// The <see cref="IComparer{T}"/> implementation to use when comparing
91public int BinarySearch(T item, IComparer<T>? comparer) => this.BinarySearch(0, this.Count, item, comparer);
102/// The <see cref="IComparer{T}"/> implementation to use when comparing
124public int BinarySearch(int index, int count, T item, IComparer<T>? comparer) => _root.BinarySearch(index, count, item, comparer);
450/// The <see cref="IComparer{T}"/> implementation to use when comparing
454public ImmutableList<T> Sort(IComparer<T>? comparer) => this.Wrap(_root.Sort(comparer));
467/// The <see cref="IComparer{T}"/> implementation to use when comparing
471public ImmutableList<T> Sort(int index, int count, IComparer<T>? comparer)
System\Collections\Immutable\ImmutableSortedDictionary.cs (10)
33public static ImmutableSortedDictionary<TKey, TValue> Create<TKey, TValue>(IComparer<TKey>? keyComparer) where TKey : notnull
46public static ImmutableSortedDictionary<TKey, TValue> Create<TKey, TValue>(IComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) where TKey : notnull
71public static ImmutableSortedDictionary<TKey, TValue> CreateRange<TKey, TValue>(IComparer<TKey>? keyComparer, IEnumerable<KeyValuePair<TKey, TValue>> items) where TKey : notnull
85public static ImmutableSortedDictionary<TKey, TValue> CreateRange<TKey, TValue>(IComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer, IEnumerable<KeyValuePair<TKey, TValue>> items) where TKey : notnull
108public static ImmutableSortedDictionary<TKey, TValue>.Builder CreateBuilder<TKey, TValue>(IComparer<TKey>? keyComparer) where TKey : notnull
121public static ImmutableSortedDictionary<TKey, TValue>.Builder CreateBuilder<TKey, TValue>(IComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) where TKey : notnull
138public static ImmutableSortedDictionary<TKey, TValue> ToImmutableSortedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) where TKey : notnull
171public static ImmutableSortedDictionary<TKey, TValue> ToImmutableSortedDictionary<TSource, TKey, TValue>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TValue> elementSelector, IComparer<TKey>? keyComparer) where TKey : notnull
200public static ImmutableSortedDictionary<TKey, TValue> ToImmutableSortedDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source, IComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer) where TKey : notnull
220public static ImmutableSortedDictionary<TKey, TValue> ToImmutableSortedDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> source, IComparer<TKey>? keyComparer) where TKey : notnull
System\Collections\Immutable\ImmutableSortedDictionary_2.cs (8)
39private readonly IComparer<TKey> _keyComparer;
51internal ImmutableSortedDictionary(IComparer<TKey>? keyComparer = null, IEqualityComparer<TValue>? valueComparer = null)
65private ImmutableSortedDictionary(Node root, int count, IComparer<TKey> keyComparer, IEqualityComparer<TValue> valueComparer)
173public IComparer<TKey> KeyComparer
321public ImmutableSortedDictionary<TKey, TValue> WithComparers(IComparer<TKey>? keyComparer, IEqualityComparer<TValue>? valueComparer)
352public ImmutableSortedDictionary<TKey, TValue> WithComparers(IComparer<TKey>? keyComparer)
739private static ImmutableSortedDictionary<TKey, TValue> Wrap(Node root, int count, IComparer<TKey> keyComparer, IEqualityComparer<TValue> valueComparer)
775/// <param name="avoidToSortedMap"><c>true</c> when being called from <see cref="WithComparers(IComparer{TKey}, IEqualityComparer{TValue})"/> to avoid a stack overflow.</param>
System\Collections\Immutable\ImmutableSortedDictionary_2.Node.cs (11)
247internal Node Add(TKey key, TValue value, IComparer<TKey> keyComparer, IEqualityComparer<TValue> valueComparer, out bool mutated)
265internal Node SetItem(TKey key, TValue value, IComparer<TKey> keyComparer, IEqualityComparer<TValue> valueComparer, out bool replacedExistingValue, out bool mutated)
281internal Node Remove(TKey key, IComparer<TKey> keyComparer, out bool mutated)
293internal ref readonly TValue ValueRef(TKey key, IComparer<TKey> keyComparer)
314internal bool TryGetValue(TKey key, IComparer<TKey> keyComparer, [MaybeNullWhen(false)] out TValue value)
345internal bool TryGetKey(TKey equalKey, IComparer<TKey> keyComparer, out TKey actualKey)
371internal bool ContainsKey(TKey key, IComparer<TKey> keyComparer)
413internal bool Contains(KeyValuePair<TKey, TValue> pair, IComparer<TKey> keyComparer, IEqualityComparer<TValue> valueComparer)
619private Node SetOrAdd(TKey key, TValue value, IComparer<TKey> keyComparer, IEqualityComparer<TValue> valueComparer, bool overwriteExistingValue, out bool replacedExistingValue, out bool mutated)
680private Node RemoveRecursive(TKey key, IComparer<TKey> keyComparer, out bool mutated)
784private Node Search(TKey key, IComparer<TKey> keyComparer)
System.Configuration.ConfigurationManager (1)
System.Data.Common (7)
System\Data\EnumerableRowCollectionExtensions.cs (4)
42public static OrderedEnumerableRowCollection<TRow> OrderBy<TRow, TKey>(this EnumerableRowCollection<TRow> source, Func<TRow, TKey> keySelector, IComparer<TKey> comparer)
65public static OrderedEnumerableRowCollection<TRow> OrderByDescending<TRow, TKey>(this EnumerableRowCollection<TRow> source, Func<TRow, TKey> keySelector, IComparer<TKey> comparer)
89public static OrderedEnumerableRowCollection<TRow> ThenBy<TRow, TKey>(this OrderedEnumerableRowCollection<TRow> source, Func<TRow, TKey> keySelector, IComparer<TKey> comparer)
113public static OrderedEnumerableRowCollection<TRow> ThenByDescending<TRow, TKey>(this OrderedEnumerableRowCollection<TRow> source, Func<TRow, TKey> keySelector, IComparer<TKey> comparer)
System.Linq (29)
System\Linq\OrderBy.cs (9)
34/// <param name="comparer">An <see cref="IComparer{T}"/> to compare keys.</param>
45public static IOrderedEnumerable<T> Order<T>(this IEnumerable<T> source, IComparer<T>? comparer) =>
53public static IOrderedEnumerable<TSource> OrderBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
79/// <param name="comparer">An <see cref="IComparer{T}"/> to compare keys.</param>
90public static IOrderedEnumerable<T> OrderDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer) =>
98public static IOrderedEnumerable<TSource> OrderByDescending<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer) =>
111public static IOrderedEnumerable<TSource> ThenBy<TSource, TKey>(this IOrderedEnumerable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
131public static IOrderedEnumerable<TSource> ThenByDescending<TSource, TKey>(this IOrderedEnumerable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
168IOrderedEnumerable<TElement> CreateOrderedEnumerable<TKey>(Func<TElement, TKey> keySelector, IComparer<TKey>? comparer, bool descending);
System\Linq\OrderedEnumerable.cs (10)
29IOrderedEnumerable<TElement> IOrderedEnumerable<TElement>.CreateOrderedEnumerable<TKey>(Func<TElement, TKey> keySelector, IComparer<TKey>? comparer, bool descending) =>
68private readonly IComparer<TKey> _comparer;
73internal OrderedIterator(IEnumerable<TElement> source, Func<TElement, TKey> keySelector, IComparer<TKey>? comparer, bool descending, OrderedIterator<TElement>? parent) :
98IComparer<TKey> comparer = _comparer;
101comparer = (IComparer<TKey>)StringComparer.CurrentCulture;
260protected readonly IComparer<TKey> _comparer;
264public CachingComparer(Func<TElement, TKey> keySelector, IComparer<TKey> comparer, bool descending)
293public CachingComparerWithChild(Func<TElement, TKey> keySelector, IComparer<TKey> comparer, bool descending, CachingComparer<TElement> child)
384private readonly IComparer<TKey> _comparer;
389internal EnumerableSorter(Func<TElement, TKey> keySelector, IComparer<TKey> comparer, bool descending, EnumerableSorter<TElement>? next)
System.Linq.AsyncEnumerable (54)
System\Linq\OrderBy.cs (32)
16/// <param name="comparer">An <see cref="IComparer{T}"/> to compare keys.</param>
21IComparer<T>? comparer = null) =>
29/// <param name="comparer">An <see cref="IComparer{T}"/> to compare keys.</param>
36IComparer<TKey>? comparer = null)
51/// <param name="comparer">An <see cref="IComparer{T}"/> to compare keys.</param>
58IComparer<TKey>? comparer = null)
71/// <param name="comparer">An <see cref="IComparer{T}"/> to compare keys.</param>
76IComparer<T>? comparer = null) =>
84/// <param name="comparer">An <see cref="IComparer{T}"/> to compare keys.</param>
91IComparer<TKey>? comparer = null)
106/// <param name="comparer">An <see cref="IComparer{T}"/> to compare keys.</param>
113IComparer<TKey>? comparer = null)
128/// <param name="comparer">An <see cref="IComparer{T}"/> to compare keys.</param>
135IComparer<TKey>? comparer = null)
147/// <param name="comparer">An <see cref="IComparer{T}"/> to compare keys.</param>
154IComparer<TKey>? comparer = null)
166/// <param name="comparer">An <see cref="IComparer{T}"/> to compare keys.</param>
173IComparer<TKey>? comparer = null)
185/// <param name="comparer">An <see cref="IComparer{T}"/> to compare keys.</param>
192IComparer<TKey>? comparer = null)
210public IOrderedAsyncEnumerable<TElement> CreateOrderedAsyncEnumerable<TKey>(Func<TElement, TKey> keySelector, IComparer<TKey>? comparer, bool descending) =>
213public IOrderedAsyncEnumerable<TElement> CreateOrderedAsyncEnumerable<TKey>(Func<TElement, CancellationToken, ValueTask<TKey>> keySelector, IComparer<TKey>? comparer, bool descending) =>
223private readonly IComparer<TKey> _comparer;
226internal OrderedIterator(IAsyncEnumerable<TElement> source, object keySelector, IComparer<TKey>? comparer, bool descending, OrderedIterator<TElement>? parent) :
242IComparer<TKey> comparer = _comparer;
245comparer = (IComparer<TKey>)StringComparer.CurrentCulture;
305private readonly IComparer<TKey> _comparer;
310internal EnumerableSorter(object keySelector, IComparer<TKey> comparer, bool descending, EnumerableSorter<TElement>? next)
440/// <param name="comparer">The <see cref="IComparer{T}"/> used to compare keys for placement in the returned sequence.</param>
443IOrderedAsyncEnumerable<TElement> CreateOrderedAsyncEnumerable<TKey>(Func<TElement, TKey> keySelector, IComparer<TKey>? comparer, bool descending);
448/// <param name="comparer">The <see cref="IComparer{T}"/> used to compare keys for placement in the returned sequence.</param>
451IOrderedAsyncEnumerable<TElement> CreateOrderedAsyncEnumerable<TKey>(Func<TElement, CancellationToken, ValueTask<TKey>> keySelector, IComparer<TKey>? comparer, bool descending);
System.Linq.Expressions (1)
System.Linq.Parallel (74)
System\Linq\Parallel\QueryOperators\Binary\GroupJoinQueryOperator.cs (11)
138IComparer<TRightKey>? rightKeyComparer, IPartitionedStreamRecipient<TOutput> outputRecipient,
144IComparer<Pair<TLeftKey, TRightKey>> outputKeyComparer = new PairComparer<TLeftKey, TRightKey>(leftHashStream.KeyComparer, rightKeyComparer);
158private static PairComparer<bool, TRightKey> CreateComparer<TRightKey>(IComparer<TRightKey> comparer)
163private static PairComparer<TLeftKey, TRightKey> CreateComparer<TLeftKey, TRightKey>(IComparer<TLeftKey> leftKeyComparer, IComparer<TRightKey> rightKeyComparer)
171HashJoinOutputKeyBuilder<TLeftKey, TRightKey, TOutputKey> outputKeyBuilder, IComparer<TOutputKey> outputKeyComparer,
307private readonly IComparer<TOrderKey> _orderKeyComparer;
312IComparer<TOrderKey> orderKeyComparer)
348private readonly IComparer<TOrderKey> _orderKeyComparer;
352IComparer<TOrderKey> orderKeyComparer)
415internal GroupKeyData(TOrderKey orderKey, THashKey hashKey, IComparer<TOrderKey> orderComparer)
System\Linq\Parallel\QueryOperators\Unary\GroupByQueryOperator.cs (8)
148IComparer<TKey> orderComparer = hashStream.KeyComparer;
428protected readonly IComparer<TOrderKey> _orderComparer; // The comparison routine for order keys.
443Func<TSource, TGroupKey> keySelector, IEqualityComparer<TGroupKey>? keyComparer, IComparer<TOrderKey> orderComparer,
517internal GroupKeyData(TOrderKey orderKey, TGroupKey hashKey, IComparer<TOrderKey> orderComparer)
539Func<TSource, TGroupKey> keySelector, IEqualityComparer<TGroupKey>? keyComparer, IComparer<TOrderKey> orderComparer,
612Func<TSource, TGroupKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TGroupKey>? keyComparer, IComparer<TOrderKey> orderComparer,
732private readonly IComparer<TOrderKey> _orderComparer; // Comparer for order keys
739IComparer<TOrderKey> orderComparer)
System\Linq\ParallelEnumerable.cs (4)
1093this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
1147this ParallelQuery<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
1208this OrderedParallelQuery<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
1269this OrderedParallelQuery<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey>? comparer)
System.Linq.Queryable (44)
System\Linq\Queryable.cs (44)
713/// <param name="comparer">An <see cref="IComparer{T}"/> to compare elements.</param>
734public static IOrderedQueryable<T> Order<T>(this IQueryable<T> source, IComparer<T> comparer)
741new Func<IQueryable<T>, IComparer<T>, IOrderedQueryable<T>>(Order).Method,
742source.Expression, Expression.Constant(comparer, typeof(IComparer<T>))));
759public static IOrderedQueryable<TSource> OrderBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer)
767new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, IOrderedQueryable<TSource>>(OrderBy).Method,
768source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>))));
812/// <param name="comparer">An <see cref="IComparer{T}"/> to compare elements.</param>
833public static IOrderedQueryable<T> OrderDescending<T>(this IQueryable<T> source, IComparer<T> comparer)
840new Func<IQueryable<T>, IComparer<T>, IOrderedQueryable<T>>(OrderDescending).Method,
841source.Expression, Expression.Constant(comparer, typeof(IComparer<T>))));
858public static IOrderedQueryable<TSource> OrderByDescending<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer)
866new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, IOrderedQueryable<TSource>>(OrderByDescending).Method,
867source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>))));
1111public static IOrderedQueryable<TSource> ThenBy<TSource, TKey>(this IOrderedQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer)
1119new Func<IOrderedQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, IOrderedQueryable<TSource>>(ThenBy).Method,
1120source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>))));
1137public static IOrderedQueryable<TSource> ThenByDescending<TSource, TKey>(this IOrderedQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer)
1145new Func<IOrderedQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, IOrderedQueryable<TSource>>(ThenByDescending).Method,
1146source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>))));
2316/// <param name="comparer">The <see cref="IComparer{T}" /> to compare values.</param>
2321public static TSource? Min<TSource>(this IQueryable<TSource> source, IComparer<TSource>? comparer)
2328new Func<IQueryable<TSource>, IComparer<TSource>, TSource?>(Min).Method,
2330Expression.Constant(comparer, typeof(IComparer<TSource>))));
2373/// <param name="comparer">The <see cref="IComparer{TSource}" /> to compare elements.</param>
2381public static TSource? MinBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TSource>? comparer)
2389new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TSource>, TSource?>(MinBy).Method,
2392Expression.Constant(comparer, typeof(IComparer<TSource>))));
2400/// <param name="comparer">The <see cref="IComparer{TKey}" /> to compare keys.</param>
2405public static TSource? MinBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer)
2413new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, TSource?>(MinBy).Method,
2416Expression.Constant(comparer, typeof(IComparer<TKey>))));
2434/// <param name="comparer">The <see cref="IComparer{T}" /> to compare values.</param>
2438public static TSource? Max<TSource>(this IQueryable<TSource> source, IComparer<TSource>? comparer)
2445new Func<IQueryable<TSource>, IComparer<TSource>, TSource?>(Max).Method,
2447Expression.Constant(comparer, typeof(IComparer<TSource>))));
2490/// <param name="comparer">The <see cref="IComparer{TSource}" /> to compare elements.</param>
2498public static TSource? MaxBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TSource>? comparer)
2506new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TSource>, TSource?>(MaxBy).Method,
2509Expression.Constant(comparer, typeof(IComparer<TSource>))));
2517/// <param name="comparer">The <see cref="IComparer{TKey}" /> to compare keys.</param>
2522public static TSource? MaxBy<TSource, TKey>(this IQueryable<TSource> source, Expression<Func<TSource, TKey>> keySelector, IComparer<TKey>? comparer)
2530new Func<IQueryable<TSource>, Expression<Func<TSource, TKey>>, IComparer<TKey>, TSource?>(MaxBy).Method,
2533Expression.Constant(comparer, typeof(IComparer<TKey>))));
System.Private.CoreLib (39)
src\libraries\System.Private.CoreLib\src\System\Array.cs (6)
1378public static int BinarySearch<T>(T[] array, T value, IComparer<T>? comparer)
1390public static int BinarySearch<T>(T[] array, int index, int length, T value, IComparer<T>? comparer)
2520public static void Sort<T>(T[] array, IComparer<T>? comparer)
2527public static void Sort<TKey, TValue>(TKey[] keys, TValue[]? items, IComparer<TKey>? comparer)
2534public static void Sort<T>(T[] array, int index, int length, IComparer<T>? comparer)
2552public static void Sort<TKey, TValue>(TKey[] keys, TValue[]? items, int index, int length, IComparer<TKey>? comparer)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (14)
19public void Sort(Span<T> keys, IComparer<T>? comparer)
38public int BinarySearch(T[] array, int index, int length, T value, IComparer<T>? comparer)
73internal static int InternalBinarySearch(T[] array, int index, int length, T value, IComparer<T> comparer)
283public void Sort(Span<T> keys, IComparer<T>? comparer)
324public int BinarySearch(T[] array, int index, int length, T value, IComparer<T>? comparer)
615public void Sort(Span<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
633private static void SwapIfGreaterWithValues(Span<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
666internal static void IntrospectiveSort(Span<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
677private static void IntroSort(Span<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
723private static int PickPivotAndPartition(Span<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
761private static void HeapSort(Span<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
779private static void DownHeap(Span<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
806private static void InsertionSort(Span<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
832public void Sort(Span<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (11)
3530public static int SequenceCompareTo<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> other, IComparer<T>? comparer = null)
4186/// <typeparam name="TComparer">The specific type of <see cref="IComparer{T}"/>.</typeparam>
4203where TComparer : IComparer<T>, allows ref struct =>
4257/// <typeparam name="TComparer">The specific type of <see cref="IComparer{T}"/>.</typeparam>
4273where TComparer : IComparer<T>, allows ref struct
4293Sort(span, (IComparer<T>?)null);
4302/// The <see cref="IComparer{T}"/> implementation to use when comparing elements, or null to
4312public static void Sort<T, TComparer>(this Span<T> span, TComparer comparer) where TComparer : IComparer<T>?
4354Sort(keys, items, (IComparer<TKey>?)null);
4366/// The <see cref="IComparer{T}"/> implementation to use when comparing elements, or null to
4376public static void Sort<TKey, TValue, TComparer>(this Span<TKey> keys, Span<TValue> items, TComparer comparer) where TComparer : IComparer<TKey>?
System.Private.DataContractSerialization (1)
System.Private.Xml (4)
System.Runtime (1)
System.Threading.Channels (2)
System.Windows.Controls.Ribbon (2)
System.Windows.Forms (8)
System.Windows.Forms.Design (2)
Test.Utilities (66)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
Text.Analyzers (74)
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (10)
597public static bool IsSorted<T>(this IEnumerable<T> enumerable, IComparer<T>? comparer = null)
823/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
825public static IOrderedEnumerable<T> OrderBy<T>(this IEnumerable<T> source, IComparer<T>? comparer)
829/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
831public static IOrderedEnumerable<T> OrderByDescending<T>(this IEnumerable<T> source, IComparer<T>? comparer)
835/// Variant of <see cref="System.Linq.Enumerable.OrderBy{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
841/// Variant of <see cref="System.Linq.Enumerable.OrderByDescending{TSource, TKey}(IEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
847/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
849public static IOrderedEnumerable<T> ThenBy<T>(this IOrderedEnumerable<T> source, IComparer<T>? comparer)
853/// Variant of <see cref="System.Linq.Enumerable.ThenBy{TSource, TKey}(IOrderedEnumerable{TSource}, Func{TSource, TKey}, IComparer{TKey}?)"/>
src\Dependencies\Collections\Internal\ArraySortHelper.cs (14)
32public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
51public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
84internal static int InternalBinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T> comparer)
297public static void Sort(SegmentedArraySegment<T> keys, IComparer<T>? comparer)
341public static int BinarySearch(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
673public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
691private static void SwapIfGreaterWithValues(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer, int i, int j)
724internal static void IntrospectiveSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
735private static void IntroSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, int depthLimit, IComparer<TKey> comparer)
781private static int PickPivotAndPartition(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
826private static void HeapSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
844private static void DownHeap(SegmentedArraySegment<TKey> keys, Span<TValue> values, int i, int n, IComparer<TKey> comparer)
871private static void InsertionSort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey> comparer)
897public static void Sort(SegmentedArraySegment<TKey> keys, Span<TValue> values, IComparer<TKey>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (8)
192/// <inheritdoc cref="ImmutableList{T}.BinarySearch(T, IComparer{T}?)"/>
193public int BinarySearch(T item, IComparer<T>? comparer)
196/// <inheritdoc cref="ImmutableList{T}.BinarySearch(int, int, T, IComparer{T}?)"/>
197public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
538/// <inheritdoc cref="ImmutableList{T}.Sort(IComparer{T}?)"/>
539public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer)
571/// <inheritdoc cref="ImmutableList{T}.Sort(int, int, IComparer{T}?)"/>
572public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (8)
65/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(T, IComparer{T}?)"/>
66public int BinarySearch(T item, IComparer<T>? comparer)
69/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.BinarySearch(int, int, T, IComparer{T}?)"/>
70public int BinarySearch(int index, int count, T item, IComparer<T>? comparer)
206/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(IComparer{T}?)"/>
207public void Sort(IComparer<T>? comparer)
214/// <inheritdoc cref="System.Collections.Immutable.ImmutableList{T}.Builder.Sort(int, int, IComparer{T}?)"/>
215public void Sort(int index, int count, IComparer<T>? comparer)
src\Dependencies\Collections\Segmented\SegmentedArray.cs (5)
179public static int BinarySearch<T>(SegmentedArray<T> array, T value, IComparer<T>? comparer)
189public static int BinarySearch<T>(SegmentedArray<T> array, int index, int length, T value, IComparer<T>? comparer)
369SegmentedArraySortHelper<T>.Sort(segment, (IComparer<T>?)null);
378public static void Sort<T>(SegmentedArray<T> array, IComparer<T>? comparer)
383public static void Sort<T>(SegmentedArray<T> array, int index, int length, IComparer<T>? comparer)
xunit.assert (4)