Range-ify a loop.