-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
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
Recommended fetch with block over args as faster #37
Comments
Thnx @schneems, I'll take a look at it, however I think I will have to make this project ruby-version specific since it seems that speed varies from version to version. |
FWIW, I just tried Ruby 1.9.3, 2.3.1, 2.3.3, and 2.4.0, and in all those versions, the argument version was faster than the block version. |
see this note on https://github.com/JuanitoFatas/fast-ruby#hashfetch-with-argument-vs-hashfetch--block-code |
@gagalago would you be open to creating a PR with a fix for this? Best, |
I can check but I will not do any promise. I am not familiar with code of fasterer (neither from other linters) so I don't know if I will be able to do it. |
Sure thing! Lemme know if you need any help figuring anything around the codebase, probably a good start would be checking this method over here: https://github.com/DamirSvrtan/fasterer/blob/master/lib/fasterer/scanners/method_call_scanner.rb#L116 |
Hey guys, if you don't mind I created a small PR with the fix |
From rails/rails#26599 i'm seeing that's not the case. Btw, this is a really cool project.
cc/ @timrogers
The text was updated successfully, but these errors were encountered: