Fix Performance/MethodObjectAsBlock cop (#24798)
This commit is contained in:
parent
97385f27bd
commit
a0c9f2447e
3 changed files with 7 additions and 12 deletions
|
@ -18,7 +18,7 @@ class AccountSuggestions::Source
|
|||
def as_ordered_suggestions(scope, ordered_list)
|
||||
return [] if ordered_list.empty?
|
||||
|
||||
map = scope.index_by(&method(:to_ordered_list_key))
|
||||
map = scope.index_by { |account| to_ordered_list_key(account) }
|
||||
|
||||
ordered_list.map { |ordered_list_key| map[ordered_list_key] }.compact.map do |account|
|
||||
AccountSuggestions::Suggestion.new(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue