4 ms·
Make it faster by replacing the block parameter with a comment: - def a(&block) + def a #&block This works when a method uses `yield` and doesn't do m
by jph 12y ago
Make it faster by replacing the block parameter with a comment:
- def a(&block)
+ def a #&block
This works when a method uses `yield` and doesn't do more with the block parameter.
Ideally Ruby would have a way to write a method signature to indicate a block is expected and/or or a yield happens, all without triggering the transformation of the block into a first class object.