1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Added GetRange

This commit is contained in:
Brian Fiete 2020-09-14 17:26:16 -07:00
parent f6132267dd
commit 7e0c25ef8f

View file

@ -323,6 +323,19 @@ namespace System.Collections
Add(item);
}
public Span<T> GetRange(int offset)
{
Debug.Assert((uint)offset <= (uint)mSize);
return .(mItems + offset, mSize - offset);
}
public Span<T> GetRange(int offset, int count)
{
Debug.Assert((uint)offset <= (uint)mSize);
Debug.Assert((uint)offset + (uint)count <= (uint)mSize);
return .(mItems + offset, count);
}
/// Returns a pointer to the start of the added uninitialized section
public T* GrowUnitialized(int addSize)
{