@@ -70,64 +70,4 @@ internal static class IncrementalValuesProviderExtensions
70
70
return result ;
71
71
} ) ;
72
72
}
73
-
74
- /// <summary>
75
- /// Creates a new <see cref="IncrementalValuesProvider{TValues}"/> instance with a given pair of comparers.
76
- /// </summary>
77
- /// <typeparam name="TLeft">The type of left items in each tuple.</typeparam>
78
- /// <typeparam name="TRight">The type of right items in each tuple.</typeparam>
79
- /// <param name="source">The input <see cref="IncrementalValuesProvider{TValues}"/> instance.</param>
80
- /// <param name="comparerLeft">An <see cref="IEqualityComparer{T}"/> instance for <typeparamref name="TLeft"/> items.</param>
81
- /// <param name="comparerRight">An <see cref="IEqualityComparer{T}"/> instance for <typeparamref name="TRight"/> items.</param>
82
- /// <returns>An <see cref="IncrementalValuesProvider{TValues}"/> with the specified comparers applied to each item.</returns>
83
- public static IncrementalValuesProvider < ( TLeft Left , TRight Right ) > WithComparers < TLeft , TRight > (
84
- this IncrementalValuesProvider < ( TLeft Left , TRight Right ) > source ,
85
- IEqualityComparer < TLeft > comparerLeft ,
86
- IEqualityComparer < TRight > comparerRight )
87
- {
88
- return source . WithComparer ( new Comparer < TLeft , TRight > ( comparerLeft , comparerRight ) ) ;
89
- }
90
-
91
- /// <summary>
92
- /// An <see cref="IEqualityComparer{T}"/> implementation for a value tuple.
93
- /// </summary>
94
- private sealed class Comparer < TLeft , TRight > : IEqualityComparer < ( TLeft Left , TRight Right ) >
95
- {
96
- /// <summary>
97
- /// The <typeparamref name="TLeft"/> comparer.
98
- /// </summary>
99
- private readonly IEqualityComparer < TLeft > comparerLeft ;
100
-
101
- /// <summary>
102
- /// The <typeparamref name="TRight"/> comparer.
103
- /// </summary>
104
- private readonly IEqualityComparer < TRight > comparerRight ;
105
-
106
- /// <summary>
107
- /// Creates a new <see cref="Comparer{TLeft, TRight}"/> instance with the specified parameters.
108
- /// </summary>
109
- /// <param name="comparerLeft">The <typeparamref name="TLeft"/> comparer.</param>
110
- /// <param name="comparerRight">The <typeparamref name="TRight"/> comparer.</param>
111
- public Comparer ( IEqualityComparer < TLeft > comparerLeft , IEqualityComparer < TRight > comparerRight )
112
- {
113
- this . comparerLeft = comparerLeft ;
114
- this . comparerRight = comparerRight ;
115
- }
116
-
117
- /// <inheritdoc/>
118
- public bool Equals ( ( TLeft Left , TRight Right ) x , ( TLeft Left , TRight Right ) y )
119
- {
120
- return
121
- this . comparerLeft . Equals ( x . Left , y . Left ) &&
122
- this . comparerRight . Equals ( x . Right , y . Right ) ;
123
- }
124
-
125
- /// <inheritdoc/>
126
- public int GetHashCode ( ( TLeft Left , TRight Right ) obj )
127
- {
128
- return HashCode . Combine (
129
- this . comparerLeft . GetHashCode ( obj . Left ) ,
130
- this . comparerRight . GetHashCode ( obj . Right ) ) ;
131
- }
132
- }
133
73
}
0 commit comments