Ways to make this loop more efficient?

Printable View