FastListCore<T>
Array-backed list with a separate element count. AsSpan covers the live range and AsArray exposes the backing array.
public struct FastListCore<T>MotionCollections.cs · L7Members
Empty
Default list with no entries.
public static readonly FastListCore<T> Empty;Length
Number of live entries in the backing array.
public readonly int Length { get; }this
Read or replace an indexed slot. Use an index below Length.
public readonly T this[int index] { get; set; }AsSpan
Return a span covering only live entries.
AsArray
Return the backing array including unused capacity.
EnsureCapacity
Reserve backing space for at least the requested number of elements.
public void EnsureCapacity(int capacity)Parameters
capacityintNumber of entries to reserve.
Add
Append an element, growing the backing array when needed.
public void Add(T element)Parameters
elementTElement to append.
RemoveAtSwapback
Remove an entry by moving the last element into its slot, which changes ordering.
public void RemoveAtSwapback(int index)Parameters
indexintIndex of the entry to operate on.
Clear
Clear the entries and reset the count. Set removeArray to also release the backing array.
public void Clear(bool removeArray = false)Parameters
removeArray = falseboolAlso release the backing array when true.
MeatMotion