Page MenuHomePhabricator

eina: Eliminate unnecessary local variables in eina_matrix3_compose.

Authored by bryceharrington on Feb 14 2018, 10:24 AM.



The results of the matrix multiplication are stored in a set of 9
variables before assignment to the outgoing matrix, but as no other math
is done subsequently, just assign to the outgoing matrix directly.

(Presumably a competent compiler would already be smart enough to
eliminate the redundant intermediate variables, so this shouldn't have
any actual performance impact. The variables do allow for a slightly
shorter line length, but this isn't a code readability benefit because
the reader has to mentally shift between x,y,z subscripts and 1,2,3
subscripts. The line length is only slightly longer with the direct
assignment, and that can be compensated by condensing spacing a bit.)

Diff Detail

rEFL core/efl
No Linters Available
No Unit Test Coverage
Build Status
Buildable 5756
Build 6389: arc lint + arc unit
bryceharrington requested review of this revision.Feb 14 2018, 10:24 AM
bryceharrington created this revision.
cedric accepted this revision.Feb 14 2018, 11:35 AM
This revision is now accepted and ready to land.Feb 14 2018, 11:35 AM
cedric requested changes to this revision.Feb 14 2018, 11:57 AM

This actually break make check. I think there is no proof that the parameter are not pointing to some of the same matrix.

This revision now requires changes to proceed.Feb 14 2018, 11:57 AM
bryceharrington abandoned this revision.Feb 14 2018, 3:31 PM

Ah true, if dst is passed as a pointer to m1 or m2 then the results of the earlier calculations interfere with the latter ones.