0
0
Fork 0

Fix Performance/MapCompact cop (#24797)

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Matt Jankowski 2023-05-23 04:49:12 -04:00 committed by GitHub
parent 0664704cd9
commit 9f5deb310b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 25 additions and 44 deletions

View file

@ -114,7 +114,7 @@ class Notification < ApplicationRecord
ActiveRecord::Associations::Preloader.new.preload(grouped_notifications, associations)
end
unique_target_statuses = notifications.map(&:target_status).compact.uniq
unique_target_statuses = notifications.filter_map(&:target_status).uniq
# Call cache_collection in block
cached_statuses_by_id = yield(unique_target_statuses).index_by(&:id)