Use iter().map() instead of for loop.

Changing as per comment in #1274