From 0105479c7ce4b5b327c20f8bb3b6a850c24b3665 Mon Sep 17 00:00:00 2001 From: Andrew Gilgallon Date: Fri, 15 Dec 2023 01:39:54 -0400 Subject: [PATCH] Replace array iteration with standard for-loop to avoid producing garbage --- src/transform/matrix.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transform/matrix.ts b/src/transform/matrix.ts index 9ce59e94..d557f68f 100644 --- a/src/transform/matrix.ts +++ b/src/transform/matrix.ts @@ -78,7 +78,7 @@ export class Matrix4x4 extends Matrix implements TransformId { let matrix = new Float32Array(16) this._rotation = new MatrixComponent(this, new Quaternion(), data => { // To extract a correct rotation, the scaling component must be eliminated. - for (let col of [0, 1, 2]) { + for (let col = 0; col < 3; col++) { matrix[col + 0] = this.array[col + 0] / this.scaling.x matrix[col + 4] = this.array[col + 4] / this.scaling.y matrix[col + 8] = this.array[col + 8] / this.scaling.z