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

Revert "add a max depth to prevent stack overflow"

This reverts commit bf245aa9d6.
This commit is contained in:
OliBomby 2024-09-24 11:44:02 +02:00
parent bf245aa9d6
commit c857de3a9a

View File

@ -305,11 +305,8 @@ namespace osu.Game.Utils
// n represents the number of points in P that are not yet processed.
private static (Vector2, float) welzlHelper(List<Vector2> points, ReadOnlySpan<Vector2> r, int n)
{
const int max_depth = 4000;
// Base case when all points processed or |R| = 3
// To prevent stack overflow, we stop at a certain depth and give an approximate answer
if (n == 0 || r.Length == 3 || points.Count - n >= max_depth)
if (n == 0 || r.Length == 3)
return minCircleTrivial(r);
// Pick a random point randomly