Will the second line of the following code
int bar;
int foo = bar * 3 * 5;
optimized for
int bar;
int foo = bar * 15;
Or even more:
int foo = 3 * bar * 5;
can be optimized?
The goal is to ask if I can just write
int foo = bar * 3 * 5;
instead
int foo = bar * (3 * 5);
to keep parentheses. (and get rid of the need to manually manipulate this constant ordering =>, and in many cases the constants of grouping with related variables are more meaningful, rather than grouping constants for optimization)
source
share