Change CWT use of GetPrimaryAndSecondary to GetPrimary
authorStephen Toub <stoub@microsoft.com>
Fri, 9 Dec 2016 21:09:26 +0000 (16:09 -0500)
committerStephen Toub <stoub@microsoft.com>
Fri, 9 Dec 2016 21:09:26 +0000 (16:09 -0500)
This snuck in as part of my previous ConditionalWeakTable changes.  We don't need the secondary here, and it's more expensive to get than just the primary.

Commit migrated from https://github.com/dotnet/coreclr/commit/4a5647ee5c5e04484c7211bcac7249d35e290977

src/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs

index 0a1eb15..89e6ad1 100644 (file)
@@ -568,9 +568,7 @@ namespace System.Runtime.CompilerServices
                     DependentHandle depHnd = _entries[entriesIndex].depHnd;
                     if (hashCode != -1 && depHnd.IsAllocated)
                     {
-                        object primary, secondary;
-                        depHnd.GetPrimaryAndSecondary(out primary, out secondary);
-                        if (primary != null)
+                        if (depHnd.GetPrimary() != null)
                         {
                             // Entry is used and has not expired. Link it into the appropriate bucket list.
                             newEntries[newEntriesIndex].HashCode = hashCode;