News for hackers. Stuff that matters.
Re:Why People Should Learn Python by ezrast on Wednesday August 24, 2016 @08:59PM (#12356293)
It's only one iteration if you throw a .lazy in there:

products.lazy.select { |product| product.type == 'x' }.map(&:price).reduce(:+)

There are no comments on this comment yet.