diff options
author | Dávid Kaya <mail@davidkaya.sk> | 2018-07-28 07:14:32 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2018-07-30 22:32:04 +0300 |
commit | 65b42e1a53ce1f9f94fe128f64168c5bf89b1da9 (patch) | |
tree | 6ad119977633122e0774da596dbf1e915f1368ef /src | |
parent | 8bda4d7a16b3783cc82ff39b7bd9f5a64ac45a45 (diff) |
Added version increment for TrimExcess and EnsureCapacity (#19096)
* Added version increment for TrimExcess and EnsureCapacity
* Added old unit test to exclusion list
* Excluded missing unit tests
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 | 2 |
1 files changed, 2 insertions, 0 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 8f7ad70e2..69363d6c0 100644 --- a/src/System.Private.CoreLib/shared/System/Collections/Generic/Dictionary.cs +++ b/src/System.Private.CoreLib/shared/System/Collections/Generic/Dictionary.cs @@ -970,6 +970,7 @@ namespace System.Collections.Generic int currentCapacity = _entries == null ? 0 : _entries.Length; if (currentCapacity >= capacity) return currentCapacity; + _version++; if (_buckets == null) return Initialize(capacity); int newSize = HashHelpers.GetPrime(capacity); @@ -1009,6 +1010,7 @@ namespace System.Collections.Generic return; int oldCount = _count; + _version++; Initialize(newSize); Entry[] entries = _entries; int[] buckets = _buckets; |