diff options
author | Ben Adams <thundercat@illyriad.co.uk> | 2018-03-21 19:33:56 +0000 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2018-03-21 12:33:56 -0700 |
commit | 06f6f87df8432ea1c9105b7b755fd5534d5f7be5 (patch) | |
tree | 488a70b7ba438fba1f44b827b9875dc18c7dada8 | |
parent | d488ef7b6e136cac6fe61a7186d158aa59bcf00f (diff) | |
download | coreclr-06f6f87df8432ea1c9105b7b755fd5534d5f7be5.tar.gz coreclr-06f6f87df8432ea1c9105b7b755fd5534d5f7be5.tar.bz2 coreclr-06f6f87df8432ea1c9105b7b755fd5534d5f7be5.zip |
Small tweaks to Dict asm size (#17096)
-rw-r--r-- | src/mscorlib/shared/System/Collections/Generic/Dictionary.cs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mscorlib/shared/System/Collections/Generic/Dictionary.cs b/src/mscorlib/shared/System/Collections/Generic/Dictionary.cs index 16b7cdc130..b62d3f8a47 100644 --- a/src/mscorlib/shared/System/Collections/Generic/Dictionary.cs +++ b/src/mscorlib/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) |