Skip to content

Commit

Permalink
Add nullable annotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel Nobel committed May 3, 2023
1 parent 92b3085 commit 571b900
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Qowaiv/Hashing/Hash.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
/// </param>
/// <returns>The new hash.</returns>
[Pure]
public Hash And<T>(T item)
public Hash And<T>(T? item)
=> Equals(default(T), item)
? this
: new(Combine(Value, HashCode(item)));
Expand All @@ -55,7 +55,7 @@ public Hash And<T>(T item)

/// <summary>Gets a randomized hash for the item.</summary>
[Pure]
public static Hash Code<T>(T item)
public static Hash Code<T>(T? item)
=> Equals(default(T), item)
? default
: new(Combine(Randomized, HashCode(item)));
Expand All @@ -80,7 +80,7 @@ public static int NotSupportedBy<T>()

/// <summary>Gets a hash, based on its type.</summary>
[Pure]
private static int HashCode<T>(T obj)
private static int HashCode<T>(T? obj)
=> obj switch
{
null => 0,
Expand Down

0 comments on commit 571b900

Please sign in to comment.