add scheduler method; fixing buffer parallel errors
This commit is contained in:
@@ -93,7 +93,8 @@ namespace StgSharp.Collections
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public T[] PopRange(int count)
|
||||
{
|
||||
int i = int.Min(count, _index) - 1;
|
||||
int i = int.Min(count, _index);
|
||||
_index -= i;
|
||||
return _values[0..i];
|
||||
}
|
||||
|
||||
@@ -147,8 +148,7 @@ namespace StgSharp.Collections
|
||||
public static CapacityFixedStack<T> Create<T>(ReadOnlySpan<T> values)
|
||||
{
|
||||
CapacityFixedStack<T> stack = new(values.Length);
|
||||
Span<T> sp = stack.GetValueLayout();
|
||||
values.CopyTo(sp);
|
||||
stack.PushRange(values);
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user