Core: use span<T> to cut down on array copys

This commit is contained in:
hondacrx
2018-12-24 01:02:49 -05:00
parent 581d0fd1ff
commit 40564a73ce
6 changed files with 32 additions and 24 deletions
+2 -1
View File
@@ -203,7 +203,8 @@ namespace Game.Maps
{
int extra = !keyFrames[i - 1].Teleport ? 1 : 0;
Spline spline = new Spline();
spline.Init_Spline(splinePath.Skip(start).ToArray(), i - start + extra, Spline.EvaluationMode.Catmullrom);
Span<Vector3> span = splinePath.ToArray();
spline.Init_Spline(span.Slice(start), i - start + extra, Spline.EvaluationMode.Catmullrom);
spline.initLengths();
for (int j = start; j < i + extra; ++j)
{