-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Bug in Performance/Count #2080
Comments
cc @rrosenblum |
I will look into this. |
I have a fix for this. I will put in a pull request shortly. In the given example, the auto correct would be incorrect because of the method name. def count(&block)
select(&block).count
end would correct to def count(&block)
count(&block)
end which would be a recursive call and not function properly. To fix the code, the method would need to be renamed, the method should be removed, or the method should call For the fix, I am not taking into consideration that the defined method name is going to be the same as the correction. |
Fine by me 👍 |
With this file
test.rb
:RuboCop tells me that
An error occurred while Performance/Count cop was inspecting /Users/bquorning/Code/rubocop/test.rb.
Extra information:
Actually, I was using the latest master, cdfb667.
The text was updated successfully, but these errors were encountered: