Class ArrayContentComparer<T>
Compares arrays by their contents rather than by reference, so two arrays with equal elements are equal.
public sealed class ArrayContentComparer<T> : IEqualityComparer<T[]> where T : struct
Type Parameters
T
- Inheritance
-
ArrayContentComparer<T>
- Implements
-
IEqualityComparer<T[]>
- Inherited Members
- Extension Methods
Fields
Instance
The reusable instance
public static readonly ArrayContentComparer<T> Instance
Field Value
Methods
Equals(T[]?, T[]?)
Determines whether the specified objects are equal.
public bool Equals(T[]? x, T[]? y)
Parameters
xT[]The first object of type
Tto compare.yT[]The second object of type
Tto compare.
Returns
GetHashCode(T[])
Returns a hash code for the specified object.
public int GetHashCode(T[] obj)
Parameters
objT[]The object for which a hash code is to be returned.
Returns
- int
A hash code for the specified object.
Exceptions
- ArgumentNullException
The type of
objis a reference type andobjis null.