We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
&:method_name
This test https://github.com/fastruby/fast-ruby/blob/master/code/general/block-apply-method.rb is comparing:
def fast [1, 2, 3].map { |n| do_something(n) } end def slow [1, 2, 3].map(&method(:do_something)) end
We could have one more test:
def other [1, 2, 3].map(&:do_something) end
Also, I think the names fast and slow shouldn't be used for the methods, the names should describe what the method does, not which one is faster?
fast
slow
The text was updated successfully, but these errors were encountered:
@arielj I guess name fast and slow just indicate which way is faster. In this case if we should not use &method because its slower.
&method
Sorry, something went wrong.
No branches or pull requests
This test https://github.com/fastruby/fast-ruby/blob/master/code/general/block-apply-method.rb is comparing:
We could have one more test:
Also, I think the names
fast
andslow
shouldn't be used for the methods, the names should describe what the method does, not which one is faster?The text was updated successfully, but these errors were encountered: