소스 검색

C#: use stackalloc to create the pivot arrays in Projection.Inverse

EyalZusiman 4 달 전
부모
커밋
2ebfeef4a8
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      modules/mono/glue/GodotSharp/GodotSharp/Core/Projection.cs

+ 2 - 2
modules/mono/glue/GodotSharp/GodotSharp/Core/Projection.cs

@@ -674,8 +674,8 @@ namespace Godot
         {
             Projection proj = this;
             int i, j, k;
-            int[] pvt_i = new int[4];
-            int[] pvt_j = new int[4]; /* Locations of pivot matrix */
+            Span<int> pvt_i = stackalloc int[4];
+            Span<int> pvt_j = stackalloc int[4]; /* Locations of pivot matrix */
             real_t pvt_val; /* Value of current pivot element */
             real_t hold; /* Temporary storage */
             real_t determinant = 1.0f;