Optimize map { ... }.compact calls (#15513)
* Optimize map { ... }.compact using Enumerable#filter_map, supported since Ruby 2.7 * Add poyfill for Enumerable#filter_map
This commit is contained in:
parent
9395143126
commit
087ed84367
22 changed files with 52 additions and 26 deletions
|
@ -27,7 +27,7 @@ module Paperclip
|
|||
return true if original_filename == other_filename
|
||||
return false if original_filename.nil?
|
||||
|
||||
formats = styles.values.map(&:format).compact
|
||||
formats = styles.values.filter_map(&:format)
|
||||
|
||||
return false if formats.empty?
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue