Fix Performance/MethodObjectAsBlock cop (#24798)
This commit is contained in:
@@ -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(
|
||||
|
Reference in New Issue
Block a user