Move invariant from loop condition to loop initializer