Skip to content

Commit

Permalink
HashCode.Combine
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusfriedman committed Dec 18, 2023
1 parent a7d2575 commit ae52377
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Common/Classes/MemorySegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ public void Update(ref byte[] source)
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
public override int GetHashCode()
{
return (int)(IsDisposed ? m_Offset ^ m_Length : (m_Array.GetHashCode() ^ m_Offset ^ m_Length));
return (IsDisposed ? HashCode.Combine(m_Offset, m_Length) : HashCode.Combine(m_Array.GetHashCode(), m_Offset, m_Length));
}

[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]
Expand Down

0 comments on commit ae52377

Please sign in to comment.