1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 23:42:54 +08:00

use collection expression instead of stackalloc

This commit is contained in:
OliBomby 2024-09-23 12:15:42 +02:00
parent 86817d0cfc
commit 203951780e

View File

@ -325,13 +325,8 @@ namespace osu.Game.Utils
return d;
// Otherwise, must be on the boundary of the MEC
// Stackalloc to avoid allocations. It's safe to assume that the length of r will be at most 3
Span<Vector2> r2 = stackalloc Vector2[r.Length + 1];
r.CopyTo(r2);
r2[r.Length] = p;
// Return the MEC for P - {p} and R U {p}
return welzlHelper(points, r2, n - 1);
return welzlHelper(points, [..r, p], n - 1);
}
#endregion