diff options
author | Peter Smulovics <peter.smulovics@gmail.com> | 2017-04-20 18:46:39 -0400 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-04-20 17:46:39 -0500 |
commit | eb2d44e166f05e1d3da06925c39289bd2c4446a8 (patch) | |
tree | 895d1609a24d528cc8d780b5a6b4e8d212e37a68 /tests/src | |
parent | 171a52d0f3471e8d829192ac828df31b5904ed06 (diff) | |
download | coreclr-eb2d44e166f05e1d3da06925c39289bd2c4446a8.tar.gz coreclr-eb2d44e166f05e1d3da06925c39289bd2c4446a8.tar.bz2 coreclr-eb2d44e166f05e1d3da06925c39289bd2c4446a8.zip |
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.
Diffstat (limited to 'tests/src')
-rw-r--r-- | tests/src/CoreMangLib/cti/system/delegate/delegategethashcode1.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/src/CoreMangLib/cti/system/delegate/delegategethashcode1.cs b/tests/src/CoreMangLib/cti/system/delegate/delegategethashcode1.cs index f2c5c5145d..05ba3629b1 100644 --- a/tests/src/CoreMangLib/cti/system/delegate/delegategethashcode1.cs +++ b/tests/src/CoreMangLib/cti/system/delegate/delegategethashcode1.cs @@ -218,7 +218,7 @@ namespace DelegateTest { bool retVal = true; - TestLibrary.TestFramework.BeginScenario("PosTest7: Use the different instance's same instance method to create two delegate which delegate object is the same,their hashcode is equal"); + TestLibrary.TestFramework.BeginScenario("PosTest7: Use the different instance's same instance method to create two delegate which delegate object is the same, their hashcode is different"); try { @@ -226,7 +226,7 @@ namespace DelegateTest booldelegate workDelegate = new booldelegate(new TestClass(1).StartWork_Bool); booldelegate workDelegate1 = new booldelegate(new TestClass1(2).StartWork_Bool ); - if (workDelegate.GetHashCode()!=workDelegate1.GetHashCode()) + if (workDelegate.GetHashCode()==workDelegate1.GetHashCode()) { TestLibrary.TestFramework.LogError("013", "HashCode is not excepted "); retVal = false; |