Tag Archives: Override Equals & GetHashCode for Structs

Coding for Performance : Override Equals & GetHashCode 4 Structs


An extremely important part of using structs is overriding the Equals and GetHashCode methods. If you don’t, you will get the default versions, which are not at all good for performance. To get an idea of how bad it is, use an IL viewer and look at the code for the ValueType.Equals method. It involves […]
Read More »