Move code that can only matter in the first loop iteration out of the loop.