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
Performance/RedundantMerge, that's unsafe-autocorrectable, suggests that I should:
Performance/RedundantMerge
Use accumulator[:low] = true instead of accumulator.merge!(low => true).
accumulator[:low] = true
accumulator.merge!(low => true)
on the code below:
[{ a: 1 }, { a: 2 }, { a: 3 }].reduce({}).each do |accumulator, current| next accumulator.merge!(low: true) if current[:a] <= 2 accumulator.merge!(low: false) end
Assignment (.=) returns the assigned value, .merge! returns product hash, and the code would stop working.
.=
.merge!
I'd like it to be smart enough not to suggest that, so I don't have to ignore it.
rubocop:disable Performance/RedundantMerge
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is your feature request related to a problem? Please describe.
Performance/RedundantMerge
, that's unsafe-autocorrectable, suggests that I should:on the code below:
Assignment (
.=
) returns the assigned value,.merge!
returns product hash, and the code would stop working.Describe the solution you'd like
I'd like it to be smart enough not to suggest that, so I don't have to ignore it.
Describe alternatives you've considered
rubocop:disable Performance/RedundantMerge
The text was updated successfully, but these errors were encountered: