Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AreEqualCollections< T >() [2/2]

static bool System.Net.Http.Headers.HeaderUtilities.AreEqualCollections< T > ( ObjectCollection< T > x,
ObjectCollection< T > y,
IEqualityComparer< T > comparer )
inlinestaticpackage
Type Constraints
T :class 

Definition at line 148 of file HeaderUtilities.cs.

148 : class
149 {
150 if (x == null)
151 {
152 if (y != null)
153 {
154 return y.Count == 0;
155 }
156 return true;
157 }
158 if (y == null)
159 {
160 return x.Count == 0;
161 }
162 if (x.Count != y.Count)
163 {
164 return false;
165 }
166 if (x.Count == 0)
167 {
168 return true;
169 }
170 bool[] array = new bool[x.Count];
171 int num = 0;
172 foreach (T item in x)
173 {
174 num = 0;
175 bool flag = false;
176 foreach (T item2 in y)
177 {
178 if (!array[num] && ((comparer == null && item.Equals(item2)) || (comparer != null && comparer.Equals(item, item2))))
179 {
180 array[num] = true;
181 flag = true;
182 break;
183 }
184 num++;
185 }
186 if (!flag)
187 {
188 return false;
189 }
190 }
191 return true;
192 }

References System.array, System.comparer, and System.item.