0
0
Fork 0

Fix Performance/MethodObjectAsBlock cop (#24798)

This commit is contained in:
Matt Jankowski 2023-05-03 04:30:54 -04:00 committed by GitHub
parent 97385f27bd
commit a0c9f2447e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 12 deletions

View file

@ -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(