Remove unnecessary captured block.

Capturing blocks isn’t free, and `yield` (which
we are already using) performs better than
capturing the block and using `block.call`.
Fix memoization to properly memoize nil.