File tree Expand file tree Collapse file tree 2 files changed +1
-21
lines changed
src/Elastic.Documentation.Configuration Expand file tree Collapse file tree 2 files changed +1
-21
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public record ConfigurationFile : ITableOfContentsScope
3737
3838 public Dictionary < string , LinkRedirect > ? Redirects { get ; }
3939
40- public HashSet < Product > Products { get ; } = new ( new ProductEqualityComparer ( ) ) ;
40+ public HashSet < Product > Products { get ; } = [ ] ;
4141
4242 public HashSet < string > ImplicitFolders { get ; } = new ( StringComparer . OrdinalIgnoreCase ) ;
4343
Original file line number Diff line number Diff line change @@ -21,23 +21,3 @@ public record Product
2121 public VersioningSystem ? VersioningSystem { get ; init ; }
2222}
2323
24- public sealed class ProductEqualityComparer : IEqualityComparer < Product > , IComparer < Product >
25- {
26- public bool Equals ( Product ? x , Product ? y ) => x ? . Id == y ? . Id ;
27- public int GetHashCode ( Product obj ) => obj . Id . GetHashCode ( ) ;
28-
29- public int Compare ( Product ? x , Product ? y )
30- {
31- if ( ReferenceEquals ( x , y ) )
32- return 0 ;
33- if ( y is null )
34- return 1 ;
35- if ( x is null )
36- return - 1 ;
37- var idComparison = string . Compare ( x . Id , y . Id , StringComparison . OrdinalIgnoreCase ) ;
38- if ( idComparison != 0 )
39- return idComparison ;
40- var displayNameComparison = string . Compare ( x . DisplayName , y . DisplayName , StringComparison . OrdinalIgnoreCase ) ;
41- return displayNameComparison != 0 ? displayNameComparison : x . VersioningSystem ? . Current . CompareTo ( y . VersioningSystem ? . Current ) ?? 0 ;
42- }
43- }
You can’t perform that action at this time.
0 commit comments