Use map + compact instead of inject.

Biggest performance win so far.