mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Added GetRange
This commit is contained in:
parent
f6132267dd
commit
7e0c25ef8f
1 changed files with 13 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue