diff options
author | Ben Adams <thundercat@illyriad.co.uk> | 2018-03-21 22:33:56 +0300 |
---|---|---|
committer | Ahson Khan <ahkha@microsoft.com> | 2018-03-21 23:31:24 +0300 |
commit | f8edf2eeb7428180cc78152ead62077b9257f4dd (patch) | |
tree | b35d6cd646531878d581e0a84fb16b93e7bb24e8 /src | |
parent | 7f872fe28841b981be47dc1c71c027e474653148 (diff) |
Small tweaks to Dict asm size (dotnet/coreclr#17096)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/System.Private.CoreLib/shared/System/Collections/Generic/Dictionary.cs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Collections/Generic/Dictionary.cs b/src/System.Private.CoreLib/shared/System/Collections/Generic/Dictionary.cs index 16b7cdc13..b62d3f8a4 100644 --- a/src/System.Private.CoreLib/shared/System/Collections/Generic/Dictionary.cs +++ b/src/System.Private.CoreLib/shared/System/Collections/Generic/Dictionary.cs @@ -268,9 +268,9 @@ namespace System.Collections.Generic _count = 0; _freeList = -1; _freeCount = 0; - _version++; Array.Clear(_entries, 0, count); } + _version++; } public bool ContainsKey(TKey key) @@ -440,6 +440,7 @@ namespace System.Collections.Generic ThrowHelper.ThrowArgumentNullException(ExceptionArgument.key); } + _version++; if (_buckets == null) { Initialize(0); @@ -471,7 +472,6 @@ namespace System.Collections.Generic if (behavior == InsertionBehavior.OverwriteExisting) { entries[i].value = value; - _version++; return true; } @@ -509,7 +509,6 @@ namespace System.Collections.Generic if (behavior == InsertionBehavior.OverwriteExisting) { entries[i].value = value; - _version++; return true; } @@ -571,7 +570,6 @@ namespace System.Collections.Generic entry.value = value; // Value in _buckets is 1-based targetBucket = index + 1; - _version++; // Value types never rehash if (default(TKey) == null && collisionCount > HashHelpers.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer) |