消除部分warning
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using JNPF.DependencyInjection;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using JNPF.DependencyInjection;
|
||||
|
||||
namespace JNPF.Common.Security;
|
||||
|
||||
@@ -49,14 +50,14 @@ public static class EqualityHelper<T>
|
||||
: this(keySelector, EqualityComparer<TV>.Default)
|
||||
{ }
|
||||
|
||||
public bool Equals(T x, T y)
|
||||
public bool Equals(T? x, T? y)
|
||||
{
|
||||
return _comparer.Equals(_keySelector(x), _keySelector(y));
|
||||
}
|
||||
|
||||
public int GetHashCode(T obj)
|
||||
public int GetHashCode([DisallowNull] T obj)
|
||||
{
|
||||
return _comparer.GetHashCode(_keySelector(obj));
|
||||
return _comparer.GetHashCode(_keySelector(obj)!);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user