Optimization of for loops using integer variable endForLoop and not
array.length, because it must be computed at every loop