Use a range-based for loop.

And avoid a signedness warning.
Simplify a lambda.