Fixing Delegate's hash code's distribution (dotnet/coreclr#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)
commit673ed336f00ba6ba5ce37e01792934c39b7641c3
tree2da80b1182a8eed9cf4f236df9c52a73fe5061d8
parenta80e8aa1626e10c8e60eda3514a757c2bec9c5e4
Fixing Delegate's hash code's distribution (dotnet/coreclr#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.

Commit migrated from https://github.com/dotnet/coreclr/commit/eb2d44e166f05e1d3da06925c39289bd2c4446a8
src/coreclr/src/mscorlib/src/System/Delegate.cs
src/coreclr/tests/src/CoreMangLib/cti/system/delegate/delegategethashcode1.cs