Skip to content

Commit

Permalink
Use HashCode.AddBytes in CodeHeaderValue.GetHashCode
Browse files Browse the repository at this point in the history
  • Loading branch information
stephentoub committed Sep 9, 2022
1 parent 2ed52e4 commit 071fe7c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,14 @@ public int GetValueAsBytes(Span<byte> destination)
public override int GetHashCode()
{
HashCode hashCode = default;
#if NET
hashCode.AddBytes(EncodedValue.Span);
#else
foreach (byte b in EncodedValue.Span)
{
hashCode.Add(b);
}
#endif
return hashCode.ToHashCode();
}

Expand Down

0 comments on commit 071fe7c

Please sign in to comment.