System.Runtime.CompilerServices.ReadOnlyCollectionBuilder.RemoveAt C# (CSharp) Méthode

RemoveAt() public méthode

Removes the ReadOnlyCollectionBuilder{T} item at the specified index.
public RemoveAt ( int index ) : void
index int The zero-based index of the item to remove.
Résultat void
        public void RemoveAt(int index)
        {
            if (index < 0 || index >= _size)
                throw new ArgumentOutOfRangeException(nameof(index));

            _size--;
            if (index < _size)
            {
                Array.Copy(_items, index + 1, _items, index, _size - index);
            }
            _items[_size] = default(T)!;
            _version++;
        }