Optimised a for iteration.