[rebuid]use dynamic wrapping instead of static wrapping
This commit is contained in:
@@ -28,7 +28,6 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace StgSharp.Collections
|
||||
@@ -88,6 +87,13 @@ namespace StgSharp.Collections
|
||||
}
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public ReadOnlySpan<T> PopRange(int count)
|
||||
{
|
||||
int i = int.Min(count, _index) - 1;
|
||||
return _values[0..i];
|
||||
}
|
||||
|
||||
public void Push(T item)
|
||||
{
|
||||
_values[++_index] = _index < _values.Length - 1 ?
|
||||
|
||||
Reference in New Issue
Block a user