1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-02 22:36:00 +02:00

Minor lib changes

This commit is contained in:
Brian Fiete 2023-05-26 09:00:20 -04:00
parent 9d125eaaf2
commit 891e4fd789
4 changed files with 58 additions and 0 deletions

View file

@ -295,6 +295,12 @@ namespace System
return Span<uint8>((uint8*)mPtr, mLength * sizeof(T));
}
public void Sort(Comparison<T> comp)
{
var sorter = Sorter<T, void>(Ptr, null, Length, comp);
sorter.[Friend]Sort(0, Length);
}
public Enumerator GetEnumerator()
{
return Enumerator(this);

View file

@ -3487,6 +3487,12 @@ namespace System
mLength = length;
}
public this(Span<uint8> data)
{
mPtr = (.)data.Ptr;
mLength = data.Length;
}
public ref char8 this[int index]
{
[Checked]