Instead of the loop, ret += p.second->produce should do the trick.