Convert a loop to range-based for.