Skip to content

Commit

Permalink
Remove var in Libraries/Utilities/MatrixMath.js (#22111)
Browse files Browse the repository at this point in the history
Summary:
Replaces the keywords var with let in Libraries/Utilities/MatrixMath.js

- [x] Check npm run flow
- [x] Check npm run flow-check-ios
- [x] Check npm run flow-check-android

[GENERAL] [ENHANCEMENT] [Libraries/Utilities/MatrixMath.js] - remove `var`
Pull Request resolved: #22111

Differential Revision: D12919285

Pulled By: TheSavior

fbshipit-source-id: dca65d2da311b5c50ab6ce7338af1cc941fb7a33
  • Loading branch information
ggtmtmgg authored and facebook-github-bot committed Nov 4, 2018
1 parent 3f069f3 commit 368518e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Libraries/Utilities/MatrixMath.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ const MatrixMath = {
);

// output values
var perspective = [];
let perspective = [];
const quaternion = [];
const scale = [];
const skew = [];
Expand All @@ -590,7 +590,7 @@ const MatrixMath = {
}
const matrix = [];
const perspectiveMatrix = [];
for (var i = 0; i < 4; i++) {
for (let i = 0; i < 4; i++) {
matrix.push([]);
for (let j = 0; j < 4; j++) {
const value = transformMatrix[i * 4 + j] / transformMatrix[15];
Expand Down Expand Up @@ -622,7 +622,7 @@ const MatrixMath = {
const transposedInversePerspectiveMatrix = MatrixMath.transpose(
inversePerspectiveMatrix,
);
var perspective = MatrixMath.multiplyVectorByMatrix(
perspective = MatrixMath.multiplyVectorByMatrix(
rightHandSide,
transposedInversePerspectiveMatrix,
);
Expand All @@ -633,14 +633,14 @@ const MatrixMath = {
}

// translation is simple
for (var i = 0; i < 3; i++) {
for (let i = 0; i < 3; i++) {
translation[i] = matrix[3][i];
}

// Now get scale and shear.
// 'row' is a 3 element array of 3 component vectors
const row = [];
for (i = 0; i < 3; i++) {
for (let i = 0; i < 3; i++) {
row[i] = [matrix[i][0], matrix[i][1], matrix[i][2]];
}

Expand Down Expand Up @@ -678,7 +678,7 @@ const MatrixMath = {
// is -1, then negate the matrix and the scaling factors.
const pdum3 = MatrixMath.v3Cross(row[1], row[2]);
if (MatrixMath.v3Dot(row[0], pdum3) < 0) {
for (i = 0; i < 3; i++) {
for (let i = 0; i < 3; i++) {
scale[i] *= -1;
row[i][0] *= -1;
row[i][1] *= -1;
Expand Down

0 comments on commit 368518e

Please sign in to comment.