4 writes to _arrayStorage
Microsoft.AspNetCore.Shared.Tests (4)
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (4)
74
_arrayStorage
= Array.Empty<KeyValuePair<TKey, TValue>>();
78
_arrayStorage
= new KeyValuePair<TKey, TValue>[capacity];
526
_arrayStorage
= null;
537
_arrayStorage
= array;
95 references to _arrayStorage
Microsoft.AspNetCore.Shared.Tests (95)
AdaptiveCapacityDictionaryTests.cs (58)
25
Assert.Empty(dict.
_arrayStorage
);
38
Assert.Empty(dict.
_arrayStorage
);
48
Assert.Null(dict.
_arrayStorage
);
56
Assert.Null(dict.
_arrayStorage
);
138
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
155
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
172
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
199
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
219
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
236
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
253
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
283
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
297
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
314
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
328
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
345
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
359
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
392
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
413
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
434
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
454
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
484
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
504
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
523
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
542
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
562
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
605
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
622
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
639
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
664
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
684
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
704
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
724
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
745
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
789
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
807
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
825
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
872
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
892
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
912
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
937
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
962
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
987
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
1015
dict.
_arrayStorage
,
1043
dict.
_arrayStorage
,
1071
dict.
_arrayStorage
,
1127
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
1145
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
1163
Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
1176
var storage = Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
1192
Assert.Null(dict.
_arrayStorage
);
1206
var storage = Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
1222
Assert.Null(dict.
_arrayStorage
);
1236
var storage = Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
1252
Assert.Null(dict.
_arrayStorage
);
1266
var storage = Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
1273
storage = Assert.IsType<KeyValuePair<string, object?>[]>(dict.
_arrayStorage
);
1319
Assert.Same(Array.Empty<KeyValuePair<string, object?>>(), value.
_arrayStorage
);
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (37)
119
if (
_arrayStorage
!= null)
130
_arrayStorage
[_count++] = new KeyValuePair<TKey, TValue>(key, value);
134
_arrayStorage
[index] = new KeyValuePair<TKey, TValue>(key, value);
157
if (
_arrayStorage
!= null)
161
var array =
_arrayStorage
;
182
if (
_arrayStorage
!= null)
186
var array =
_arrayStorage
;
205
if (
_arrayStorage
!= null)
223
if (
_arrayStorage
!= null)
229
Debug.Assert(
_arrayStorage
== null);
239
_arrayStorage
[_count] = new KeyValuePair<TKey, TValue>(key, value);
256
if (
_arrayStorage
!= null)
258
Array.Clear(
_arrayStorage
, 0, _count);
302
if (
_arrayStorage
!= null)
309
var storage =
_arrayStorage
;
348
if (
_arrayStorage
!= null)
356
var array =
_arrayStorage
;
379
if (
_arrayStorage
!= null)
390
var array =
_arrayStorage
;
418
if (
_arrayStorage
!= null)
430
var array =
_arrayStorage
;
458
if (
_arrayStorage
!= null)
472
_arrayStorage
[Count] = new KeyValuePair<TKey, TValue>(key, value);
488
if (
_arrayStorage
!= null)
505
if (
_arrayStorage
!.Length >= capacity)
515
Debug.Assert(
_arrayStorage
!= null);
520
foreach (var item in
_arrayStorage
)
530
capacity =
_arrayStorage
.Length == 0 ? DefaultArrayThreshold :
_arrayStorage
.Length * 2;
534
Array.Copy(
_arrayStorage
, 0, array, 0, _count);
545
Debug.Assert(
_arrayStorage
is not null);
546
Debug.Assert(_count <=
_arrayStorage
.Length);
548
ref var r = ref MemoryMarshal.GetArrayDataReference(
_arrayStorage
);
557
Debug.Assert(
_arrayStorage
!= null);
577
Debug.Assert(
_arrayStorage
!= null);
647
if (dictionary.
_arrayStorage
!= null)
654
Current = dictionary.
_arrayStorage
[_index];