Constructor ComparerEquatableArray
ComparerEquatableArray(ImmutableArray<T>, IEqualityComparer<T>?)
Initializes a new instance of the ComparerEquatableArray<T> class from the given immutable array and comparer.
Declaration
public ComparerEquatableArray(ImmutableArray<T> array, IEqualityComparer<T>? comparer = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ImmutableArray<T> | array | |
| IEqualityComparer<T> | comparer |
Remarks
Note: values of the array are assumed to be immutable and interchangeable (that is, the standard equality and hash code contracts must be held, but also must be consistent indefinitely, and the value you read out of the array is only guaranteed to be equal to the one passed in, not necessarily the same instance or bits). Note: this constructor does not de-duplicate against existing instances when created (however, it can still later) - it is a quick constructor that just copies the provided value directly, other than ensuring non-null - use methods on ComparerEquatableArray to get de-duplication.
Note: the values for the comparer are compared by reference equality, but with null considered equivalent to Default.