In this example, the poster has overridden the get hash code method. I understand that this has been done in order to provide a better hash value for the returned object, to reduce the number of collisions, and therefore reduce the number of occasions it will be necessary to call Equals().
What i would like to know, is how this algorithm been calculated:
return 17 + 31 * CurrentState.GetHashCode() + 31 * Command.GetHashCode();
Is there a particular reason that the numbers in question were chosen? Could i have simply picked my own numbers to put into it?
-1134271262, and a multiplier of-1521134295. Just sayin'-1521134295multiplier in ILDASM but theseedappears to be a composite seed (it's a random int32 multiplied by the same multiplier). So the seed's not only NOT prime (contrary to popular belief), it's also random based on the anon-type member names/type/count. Weird. Any ideas why?