Implemented interface member:
method
Compare
System.Collections.Generic.IComparer<T>.Compare(T, T)
12 overrides of Compare
System.Collections (1)
System\Collections\Generic\SortedDictionary.cs (1)
845public override int Compare(KeyValuePair<TKey, TValue> x, KeyValuePair<TKey, TValue> y)
System.IO.Compression (1)
System\IO\Compression\ZipArchiveEntry.cs (1)
1732public override int Compare(ZipArchiveEntry? x, ZipArchiveEntry? y)
System.Linq.Parallel (5)
System\Linq\Parallel\Utils\Util.cs (5)
66public override int Compare(int x, int y) 76public override int Compare(long x, long y) 86public override int Compare(float x, float y) 96public override int Compare(double x, double y) 106public override int Compare(DateTime x, DateTime y)
System.Private.CoreLib (5)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Comparer.cs (4)
44public override int Compare(T? x, T? y) => _comparison(x!, y!); 58public override int Compare(T? x, T? y) 93public override int Compare(T? x, T? y) 117public override int Compare(T? x, T? y)
src\System\Collections\Generic\Comparer.CoreCLR.cs (1)
21public override int Compare(T x, T y)
104 references to Compare
GenerateDocumentationAndConfigFiles (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
167? Comparer<object>.Default.Compare(f1.ConstantValue, f2.ConstantValue!)
Microsoft.AspNetCore.Routing (2)
Matching\HostMatcherPolicy.cs (2)
426var result = Comparer<string>.Default.Compare(Host, other.Host); 432return Comparer<int?>.Default.Compare(Port, other.Port);
Microsoft.Build (7)
BackEnd\Components\Scheduler\Scheduler.cs (1)
1361return Comparer<int>.Default.Compare(configurationCountsByNode[left], configurationCountsByNode[right]);
BackEnd\Components\Scheduler\SchedulingPlan.cs (6)
114configurationsInOrder.Sort((l, r) => Comparer<int>.Default.Compare(l.Key, r.Key)); 237projectsInOrderOfTotalPlanTime.Sort((left, right) => Comparer<double>.Default.Compare(right.Value.TotalPlanTime, left.Value.TotalPlanTime)); 260projectsInOrderOfImmediateChildCount.Sort((left, right) => Comparer<int>.Default.Compare(right.Value.ReferencesCount, left.Value.ReferencesCount)); 276projectsInOrderOfReference.Sort(delegate (int left, int right) { return -Comparer<int>.Default.Compare(_configIdToPaths[left].Count, _configIdToPaths[right].Count); }); 337projectsByExpense.Sort(delegate (PlanConfigData left, PlanConfigData right) { return -Comparer<double>.Default.Compare(left.AccumulatedTime, right.AccumulatedTime); }); 345pathsByLength.Sort(delegate (Stack<PlanConfigData> left, Stack<PlanConfigData> right) { return Comparer<int>.Default.Compare(left.Count, right.Count); });
Microsoft.Build.Engine.UnitTests (1)
Evaluation\SimpleVersion_Tests.cs (1)
128Assert.Equal(expectedSign, Comparer<SimpleVersion>.Default.Compare(version1, version2));
Microsoft.CodeAnalysis.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
167? Comparer<object>.Default.Compare(f1.ConstantValue, f2.ConstantValue!)
Microsoft.CodeAnalysis.AnalyzerUtilities (2)
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ParameterValidationAnalysis\ParameterValidationAnalysis.ParameterValidationAbstractValueDomain.cs (1)
28return Comparer<ParameterValidationAbstractValue>.Default.Compare(oldValue, newValue);
src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysis.NullAbstractValueDomain.cs (1)
26return Comparer<NullAbstractValue>.Default.Compare(oldValue, newValue);
Microsoft.CodeAnalysis.BannedApiAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
167? Comparer<object>.Default.Compare(f1.ConstantValue, f2.ConstantValue!)
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
167? Comparer<object>.Default.Compare(f1.ConstantValue, f2.ConstantValue!)
Microsoft.CodeAnalysis.EditorFeatures (1)
IntelliSense\AsyncCompletion\ItemManager.cs (1)
193return Comparer<RoslynCompletionItem?>.Default.Compare(xRoslyn, yRoslyn);
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
167? Comparer<object>.Default.Compare(f1.ConstantValue, f2.ConstantValue!)
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
167? Comparer<object>.Default.Compare(f1.ConstantValue, f2.ConstantValue!)
Microsoft.Data.Analysis (4)
PrimitiveDataFrameColumn.cs (4)
705if (comparer.Compare(value.Value, min) < 0) 708if (comparer.Compare(value.Value, max) > 0) 738if (comparer.Compare(value.Value, min) >= 0 && comparer.Compare(value.Value, max) <= 0)
Microsoft.ML.Core (1)
Utilities\VBufferUtils.cs (1)
327pred = pred ?? ((ref T val) => Comparer<T>.Default.Compare(val, default(T)) == 0);
Microsoft.ML.FastTree (1)
Training\EnsembleCompression\LassoBasedEnsembleCompressor.cs (1)
102return Comparer<double>.Default.Compare(c1.Value, c2.Value);
Roslyn.Diagnostics.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
167? Comparer<object>.Default.Compare(f1.ConstantValue, f2.ConstantValue!)
System.Collections (7)
System\Collections\Generic\PriorityQueue.cs (6)
274if (Comparer<TPriority>.Default.Compare(priority, root.Priority) > 0) 369if (Comparer<TPriority>.Default.Compare(priority, root.Priority) > 0) 540if (Comparer<TPriority>.Default.Compare(lastNode.Priority, priority) < 0) 731if (Comparer<TPriority>.Default.Compare(node.Priority, parent.Priority) < 0) 804if (Comparer<TPriority>.Default.Compare(nextChild.Priority, minChild.Priority) < 0) 812if (Comparer<TPriority>.Default.Compare(node.Priority, minChild.Priority) <= 0)
System\Collections\StructuralComparisons.cs (1)
74return Comparer<object>.Default.Compare(x, y);
System.Collections.Immutable (4)
System\Collections\Frozen\SmallValueTypeComparableFrozenDictionary.cs (2)
48if (Comparer<TKey>.Default.Compare(key, _max) <= 0) 53int c = Comparer<TKey>.Default.Compare(key, keys[i]);
System\Collections\Frozen\SmallValueTypeComparableFrozenSet.cs (2)
44if (Comparer<T>.Default.Compare(item, _max) <= 0) 49int c = Comparer<T>.Default.Compare(item, items[i]);
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Metrics\InstrumentAdvice.cs (1)
60if (comparer.Compare(values[i - 1], values[i]) >= 0)
System.IO.Packaging (1)
System\IO\Packaging\Package.cs (1)
409Array.Sort(parts, Comparer<PackagePart>.Create((partA, partB) => uriComparer.Compare((PackUriHelper.ValidatedPartUri)partA.Uri, (PackUriHelper.ValidatedPartUri)partB.Uri)));
System.Linq (13)
System\Linq\Max.cs (4)
374if (Comparer<TSource>.Default.Compare(next, value) > 0) 491if (Comparer<TKey>.Default.Compare(nextKey, key) > 0) 831if (x is not null && comparer.Compare(x, value) > 0) 848if (Comparer<TResult>.Default.Compare(x, value) > 0)
System\Linq\Min.cs (4)
353if (Comparer<TSource>.Default.Compare(next, value) < 0) 470if (Comparer<TKey>.Default.Compare(nextKey, key) < 0) 795if (x is not null && comparer.Compare(x, value) < 0) 812if (Comparer<TResult>.Default.Compare(x, value) < 0)
System\Linq\OrderedEnumerable.cs (3)
238span.Sort(static (a, b) => Comparer<TElement>.Default.Compare(b, a)); 454int c = Comparer<TKey>.Default.Compare(keys[index1], keys[index2]); 470int c = Comparer<TKey>.Default.Compare(keys[index2], keys[index1]);
System\Linq\OrderedEnumerable.SpeedOpt.cs (2)
413if (Comparer<TElement>.Default.Compare(nextValue, resultValue) < 0) 424if (Comparer<TElement>.Default.Compare(nextValue, resultValue) >= 0)
System.Linq.AsyncEnumerable (8)
System\Linq\MaxAsync.cs (1)
102if (Comparer<TSource>.Default.Compare(next, value) > 0)
System\Linq\MaxByAsync.cs (2)
96if (Comparer<TKey>.Default.Compare(nextKey, key) > 0) 206if (Comparer<TKey>.Default.Compare(nextKey, key) > 0)
System\Linq\MinAsync.cs (1)
99if (Comparer<TSource>.Default.Compare(next, value) < 0)
System\Linq\MinByAsync.cs (2)
96if (Comparer<TKey>.Default.Compare(nextKey, key) < 0) 206if (Comparer<TKey>.Default.Compare(nextKey, key) < 0)
System\Linq\OrderBy.cs (2)
397int c = Comparer<TKey>.Default.Compare(keys[index1], keys[index2]); 413int c = Comparer<TKey>.Default.Compare(keys[index2], keys[index1]);
System.Linq.Parallel (2)
System\Linq\Parallel\Enumerables\AggregationMinMaxHelpers.cs (2)
75(!accumulator.First || Util.Sign(comparer.Compare(element, accumulator.Second)) == sign)) 99(!accumulator.First || Util.Sign(comparer.Compare(element.Second, accumulator.Second)) == sign))
System.Private.CoreLib (41)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Comparer.cs (2)
29if (x is T && y is T) return Compare((T)x, (T)y); 97if (y.HasValue) return Comparer<T>.Default.Compare(x.value, y.value);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\ManifestBuilder.cs (1)
371sortedChannels.Sort((p1, p2) => -Comparer<ulong>.Default.Compare(p1.Value.Keywords, p2.Value.Keywords));
src\libraries\System.Private.CoreLib\src\System\Nullable.cs (1)
83if (n2.HasValue) return Comparer<T>.Default.Compare(n1.value, n2.value);
src\libraries\System.Private.CoreLib\src\System\ValueTuple.cs (37)
323return Comparer<T1>.Default.Compare(Item1, objTuple.Item1); 342return Comparer<T1>.Default.Compare(Item1, other.Item1); 533int c = Comparer<T1>.Default.Compare(Item1, other.Item1); 536return Comparer<T2>.Default.Compare(Item2, other.Item2); 724int c = Comparer<T1>.Default.Compare(Item1, other.Item1); 727c = Comparer<T2>.Default.Compare(Item2, other.Item2); 730return Comparer<T3>.Default.Compare(Item3, other.Item3); 931int c = Comparer<T1>.Default.Compare(Item1, other.Item1); 934c = Comparer<T2>.Default.Compare(Item2, other.Item2); 937c = Comparer<T3>.Default.Compare(Item3, other.Item3); 940return Comparer<T4>.Default.Compare(Item4, other.Item4); 1156int c = Comparer<T1>.Default.Compare(Item1, other.Item1); 1159c = Comparer<T2>.Default.Compare(Item2, other.Item2); 1162c = Comparer<T3>.Default.Compare(Item3, other.Item3); 1165c = Comparer<T4>.Default.Compare(Item4, other.Item4); 1168return Comparer<T5>.Default.Compare(Item5, other.Item5); 1399int c = Comparer<T1>.Default.Compare(Item1, other.Item1); 1402c = Comparer<T2>.Default.Compare(Item2, other.Item2); 1405c = Comparer<T3>.Default.Compare(Item3, other.Item3); 1408c = Comparer<T4>.Default.Compare(Item4, other.Item4); 1411c = Comparer<T5>.Default.Compare(Item5, other.Item5); 1414return Comparer<T6>.Default.Compare(Item6, other.Item6); 1660int c = Comparer<T1>.Default.Compare(Item1, other.Item1); 1663c = Comparer<T2>.Default.Compare(Item2, other.Item2); 1666c = Comparer<T3>.Default.Compare(Item3, other.Item3); 1669c = Comparer<T4>.Default.Compare(Item4, other.Item4); 1672c = Comparer<T5>.Default.Compare(Item5, other.Item5); 1675c = Comparer<T6>.Default.Compare(Item6, other.Item6); 1678return Comparer<T7>.Default.Compare(Item7, other.Item7); 1945int c = Comparer<T1>.Default.Compare(Item1, other.Item1); 1948c = Comparer<T2>.Default.Compare(Item2, other.Item2); 1951c = Comparer<T3>.Default.Compare(Item3, other.Item3); 1954c = Comparer<T4>.Default.Compare(Item4, other.Item4); 1957c = Comparer<T5>.Default.Compare(Item5, other.Item5); 1960c = Comparer<T6>.Default.Compare(Item6, other.Item6); 1963c = Comparer<T7>.Default.Compare(Item7, other.Item7); 1966return Comparer<TRest>.Default.Compare(Rest, other.Rest);
Text.Analyzers (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
167? Comparer<object>.Default.Compare(f1.ConstantValue, f2.ConstantValue!)