On 2 November 2013 14:52, Sean Owen <sro...@apache.org> wrote:
> In Math, is there any appetite for large patches containing many
> instances of particular micro-optimizations? Examples:
>
> - Replace:
>     a[i][j] = a[i][j] + foo;
>   with:
>     a[i][j] += foo;
>   … which is faster/leaner in the byte code by a little bit. It might
> make a difference in many nested, tight loops.

Regardless of any speedup, it's safer not to repeat the value.

a[i][j] = a[i][j] + foo;
looks a lot like
a[i][j] = a[i][i] + foo;
or
a[i][j] = a[j][i] + foo;
at first glance, whereas
a[i][j] += foo;
is unambiguous, and much clearer.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to