Commit 3bcaadb
authored
Stored the initial capacity of the ConcurrentDictionary for correctly sizing the backing array after clearing the collection. (#108065)
* Stored the initial capacity of the ConcurrentDictionary for correctly sizing the backing array after clearing the collection.
* Stored the capacity in the ctor.
* Used the stored capacity in Clear().
Fixes #107016
* Added a test to check the capacity logic of the ConcurrentDictionary.1 parent 0372b50 commit 3bcaadb
File tree
2 files changed
+40
-1
lines changed- src/libraries/System.Collections.Concurrent
- src/System/Collections/Concurrent
- tests/ConcurrentDictionary
2 files changed
+40
-1
lines changedLines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
220 | 225 | | |
221 | 226 | | |
222 | 227 | | |
| 228 | + | |
223 | 229 | | |
224 | 230 | | |
225 | 231 | | |
| |||
716 | 722 | | |
717 | 723 | | |
718 | 724 | | |
719 | | - | |
| 725 | + | |
720 | 726 | | |
721 | 727 | | |
722 | 728 | | |
| |||
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
954 | 954 | | |
955 | 955 | | |
956 | 956 | | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
957 | 976 | | |
958 | 977 | | |
959 | 978 | | |
| |||
1231 | 1250 | | |
1232 | 1251 | | |
1233 | 1252 | | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
1234 | 1267 | | |
1235 | 1268 | | |
1236 | 1269 | | |
| |||
0 commit comments