Fixing Delegate's hash code's distribution (#11019)
authorPeter Smulovics <peter.smulovics@gmail.com>
Thu, 20 Apr 2017 22:46:39 +0000 (18:46 -0400)
committerJan Kotas <jkotas@microsoft.com>
Thu, 20 Apr 2017 22:46:39 +0000 (17:46 -0500)
commiteb2d44e166f05e1d3da06925c39289bd2c4446a8
tree895d1609a24d528cc8d780b5a6b4e8d212e37a68
parent171a52d0f3471e8d829192ac828df31b5904ed06
Fixing Delegate's hash code's distribution (#11019)

Delegate's GetHashCode just returns the hash code of the delegate type. For a scenario where delegates are used as keys in a dictionary, this leads to obvious performance problems. We should look at coming up with a better GetHashCode that properly factors in the target object and method, in all of the various forms a delegate can take.
src/mscorlib/src/System/Delegate.cs
tests/src/CoreMangLib/cti/system/delegate/delegategethashcode1.cs