style: Cleanup multiply().

We assign all the members, the result matrix doesn't really need to be any clone
of a.

Bug: 1459403
Reviewed-by: hiro
MozReview-Commit-ID: 3NkhvyfqQL
This commit is contained in:
Emilio Cobos Álvarez 2018-05-26 23:46:14 +02:00
parent 4c51624bcf
commit 66b8bd2829
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -2213,16 +2213,17 @@ impl From<MatrixDecomposed3D> for Matrix3D {
// Multiplication of two 4x4 matrices.
fn multiply(a: Matrix3D, b: Matrix3D) -> Matrix3D {
let mut a_clone = a;
Matrix3D {
% for i in range(1, 5):
% for j in range(1, 5):
a_clone.m${i}${j} = (a.m${i}1 * b.m1${j}) +
(a.m${i}2 * b.m2${j}) +
(a.m${i}3 * b.m3${j}) +
(a.m${i}4 * b.m4${j});
% endfor
% for j in range(1, 5):
m${i}${j}:
a.m${i}1 * b.m1${j} +
a.m${i}2 * b.m2${j} +
a.m${i}3 * b.m3${j} +
a.m${i}4 * b.m4${j},
% endfor
a_clone
% endfor
}
}
impl Matrix3D {