1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 15:57:24 +08:00

Use Slice method instead of index range operators for readability

This commit is contained in:
Salman Ahmed 2024-03-19 02:43:34 +03:00
parent a11e63b184
commit a8ce6a0bba

View File

@ -303,16 +303,16 @@ namespace osu.Game.Rulesets.Objects.Legacy
{
int startIndex = segmentsBuffer[i].StartIndex;
int endIndex = segmentsBuffer[i + 1].StartIndex;
controlPoints.AddRange(convertPoints(segmentsBuffer[i].Type, allPoints[startIndex..endIndex], pointsBuffer[endIndex]));
controlPoints.AddRange(convertPoints(segmentsBuffer[i].Type, allPoints.Slice(startIndex, endIndex - startIndex), pointsBuffer[endIndex]));
}
else
{
int startIndex = segmentsBuffer[i].StartIndex;
controlPoints.AddRange(convertPoints(segmentsBuffer[i].Type, allPoints[startIndex..], null));
controlPoints.AddRange(convertPoints(segmentsBuffer[i].Type, allPoints.Slice(startIndex), null));
}
}
return mergePointsLists(controlPoints);
return mergeControlPointsLists(controlPoints);
}
finally
{
@ -402,7 +402,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
- (p1.X - p0.X) * (p2.Y - p0.Y));
}
private PathControlPoint[] mergePointsLists(List<ArraySegment<PathControlPoint>> controlPointList)
private PathControlPoint[] mergeControlPointsLists(List<ArraySegment<PathControlPoint>> controlPointList)
{
int totalCount = 0;