schema: Replace two loops with comprehensions.