MarcusRescue wrote:
I do not believe that it will make much difference, but I think that
the second option is faster than the first one (milliseconds) therefore
theoretically, in the first example the compiler will go to create and
to destroy variable j I times.
Depending on the sizes of I and J it will probably unroll the loop
several times. If they are small enough, they will be allocated very few
times.
Since this particular instance is such a miniscule if any increase in
speed, you should go with clearer code rather than boosting speed.
--Paul