Remove superfluous list comprehensions in favour of generators.

Mostly aesthetic, but may improve performance a bit.