1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-25 02:58:02 +02:00

Allow method reference for Sort comparer

This commit is contained in:
disarray2077 2024-02-15 22:26:10 -03:00
parent 1c310e1bec
commit bdd034952a
4 changed files with 54 additions and 10 deletions

View file

@ -301,7 +301,14 @@ namespace System
public void Sort(Comparison<T> comp)
{
var sorter = Sorter<T, void>(Ptr, null, Length, comp);
var sorter = Sorter<T, void, Comparison<T>>(Ptr, null, Length, comp);
sorter.[Friend]Sort(0, Length);
}
public void Sort<TComparer>(TComparer comp)
where TComparer : Comparison<T>
{
var sorter = Sorter<T, void, TComparer>(Ptr, null, Length, comp);
sorter.[Friend]Sort(0, Length);
}