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
If we need to look for value, map is usually better option than array.
map
array
I often see something like this:
values = <collect into array> collection.each do |item| values.select { |v| v['attr'] = item.some_method } end
It could be more performant to have this instead:
values = <collect into map> collection.each do |item| values[item.some_method] end
Maybe a new cop could help here. Since map is not always the right choice, some enforcing style options could be useful too.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If we need to look for value,
map
is usually better option thanarray
.I often see something like this:
It could be more performant to have this instead:
Maybe a new cop could help here.
Since
map
is not always the right choice, some enforcing style options could be useful too.The text was updated successfully, but these errors were encountered: