You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
795 B
28 lines
795 B
5 years ago
|
// Needed for NET35 (ConditionalWeakTable)
|
||
|
#if !NET_4_6
|
||
|
using System.Collections.Generic;
|
||
|
using LinqInternal.Threading.Needles;
|
||
|
|
||
|
namespace LinqInternal.Collections.Specialized
|
||
|
{
|
||
|
[System.Diagnostics.DebuggerNonUserCode]
|
||
|
internal sealed class NeedleConversionEqualityComparer<TNeedle, T> : ConversionEqualityComparer<TNeedle, T>, IEqualityComparer<TNeedle>
|
||
|
where TNeedle : INeedle<T>
|
||
|
{
|
||
|
public NeedleConversionEqualityComparer(IEqualityComparer<T> comparer)
|
||
|
: base(comparer, Conversion)
|
||
|
{
|
||
|
// Empty
|
||
|
}
|
||
|
|
||
|
private static T Conversion(TNeedle needle)
|
||
|
{
|
||
|
if (ReferenceEquals(needle, null))
|
||
|
{
|
||
|
return default(T);
|
||
|
}
|
||
|
return needle.Value;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
#endif
|