From 66b8bd2829b1aec70c41a082a99a4d18ff0c45dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sat, 26 May 2018 23:46:14 +0200 Subject: [PATCH] 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 --- .../helpers/animated_properties.mako.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 3178a14add6..1071671968a 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -2213,16 +2213,17 @@ impl From 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 {