9 writes to _items
System.Private.CoreLib (9)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (9)
39
_items
= s_emptyArray;
52
_items
= s_emptyArray;
54
_items
= new T[capacity];
71
_items
= s_emptyArray;
75
_items
= new T[count];
82
_items
= s_emptyArray;
116
_items
= newItems;
120
_items
= s_emptyArray;
484
_items
= newItems;
80 references to _items
System.Private.CoreLib (80)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\CollectionExtensions.cs (7)
105
if (list.
_items
.Length - list._size < source.Length)
110
source.CopyTo(list.
_items
.AsSpan(list._size));
137
if (list.
_items
.Length - list._size < source.Length)
147
Array.Copy(list.
_items
, index, list.
_items
, index + source.Length, list._size - index);
153
source.CopyTo(list.
_items
.AsSpan(index));
172
new ReadOnlySpan<T>(list.
_items
, 0, list._size).CopyTo(destination);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (70)
76
c.CopyTo(
_items
, 0);
99
get =>
_items
.Length;
107
if (value !=
_items
.Length)
114
Array.Copy(
_items
, newItems, _size);
152
return
_items
[index];
161
_items
[index] = value;
199
T[] array =
_items
;
216
Debug.Assert(_size ==
_items
.Length);
220
_items
[size] = item;
255
if (
_items
.Length - _size < count)
260
c.CopyTo(
_items
, _size);
309
return Array.BinarySearch(
_items
, index, count, item, comparer);
329
Array.Clear(
_items
, 0, size); // Clear the elements so that the gc can reclaim the references.
374
list.
_items
[i] = converter(
_items
[i]);
397
Array.Copy(
_items
, 0, array!, arrayIndex, _size);
417
Array.Copy(
_items
, index, array, arrayIndex, count);
423
Array.Copy(
_items
, 0, array, arrayIndex, _size);
439
if (
_items
.Length < capacity)
444
return
_items
.Length;
476
Array.Copy(
_items
, newItems, length: indexToInsert);
481
Array.Copy(
_items
, indexToInsert, newItems, indexToInsert + insertionCount, _size - indexToInsert);
490
Debug.Assert(
_items
.Length < capacity);
492
int newCapacity =
_items
.Length == 0 ? DefaultCapacity : 2 *
_items
.Length;
517
if (match(
_items
[i]))
519
return
_items
[i];
535
if (match(
_items
[i]))
537
list.Add(
_items
[i]);
569
if (match(
_items
[i])) return i;
583
if (match(
_items
[i]))
585
return
_items
[i];
630
if (match(
_items
[i]))
653
action(
_items
[i]);
691
Array.Copy(
_items
, index, list.
_items
, 0, count);
719
=> Array.IndexOf(
_items
, item, 0, _size);
743
return Array.IndexOf(
_items
, item, index, _size - index);
763
return Array.IndexOf(
_items
, item, index, count);
777
if (_size ==
_items
.Length)
783
Array.Copy(
_items
, index,
_items
, index + 1, _size - index);
785
_items
[index] = item;
826
if (
_items
.Length - _size < count)
832
Array.Copy(
_items
, index,
_items
, index + count, _size - index);
839
Array.Copy(
_items
, 0,
_items
, index, index);
841
Array.Copy(
_items
, index + count,
_items
, index * 2, _size - index);
845
c.CopyTo(
_items
, index);
935
return Array.LastIndexOf(
_items
, item, index, count);
972
while (freeIndex < _size && !match(
_items
[freeIndex])) freeIndex++;
979
while (current < _size && match(
_items
[current])) current++;
984
_items
[freeIndex++] =
_items
[current++];
990
Array.Clear(
_items
, freeIndex, _size - freeIndex); // Clear the elements so that the gc can reclaim the references.
1010
Array.Copy(
_items
, index + 1,
_items
, index, _size - index);
1014
_items
[_size] = default!;
1040
Array.Copy(
_items
, index + count,
_items
, index, _size - index);
1046
Array.Clear(
_items
, _size, count);
1077
Array.Reverse(
_items
, index, count);
1117
Array.Sort(
_items
, index, count, comparer);
1131
ArraySortHelper<T>.Sort(new Span<T>(
_items
, 0, _size), comparison);
1146
Array.Copy(
_items
, array, _size);
1161
int threshold = (int)(((double)
_items
.Length) * 0.9);
1177
if (!match(
_items
[i]))
1210
_current = localList.
_items
[_index];
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (3)
28
T[] items = list.
_items
;
37
Debug.Assert(typeof(T[]) == list.
_items
.GetType(), "Implementation depends on List<T> always using a T[] and not U[] where U : T.");
132
Array.Clear(list.
_items
, count, list._size - count);