The method GetHashCode() on an integer simply returns the original value of the integer. This method call is therefore redundant, inefficient, and obscures the logic of the hash function. Several of the built-in types have this behavior, including int, uint, short, ushort, long, ulong, byte and sbyte.

Remove the call to GetHashCode(), and review the hash function.

The following hash function has two problems. Firstly, the calls to GetHashCode() are redundant, and secondly, the hash function generates too many collisions.

These problems are resolved by removing the redundant calls to GetHashCode(), and by changing the hash function to generate fewer collisions.

  • MSDN, C# Reference, Object.GetHashCode Method.