File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
activesupport/lib/active_support Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -617,13 +617,7 @@ def delete_entry(key, **options)
617617 # Deletes multiples entries in the cache implementation. Subclasses MAY
618618 # implement this method.
619619 def delete_multi_entries ( entries , **options )
620- entries . inject ( 0 ) do |sum , key |
621- if delete_entry ( key , **options )
622- sum + 1
623- else
624- sum
625- end
626- end
620+ entries . count { |key | delete_entry ( key , **options ) }
627621 end
628622
629623 # Merges the default options with ones specific to a method call.
@@ -687,7 +681,7 @@ def expanded_key(key)
687681 expanded_key ( key . first )
688682 end
689683 when Hash
690- key . collect { |k , v | "#{ k } =#{ v } " } . sort
684+ key . collect { |k , v | "#{ k } =#{ v } " } . sort!
691685 else
692686 key
693687 end . to_param
@@ -700,7 +694,7 @@ def normalize_version(key, options = nil)
700694 def expanded_version ( key )
701695 case
702696 when key . respond_to? ( :cache_version ) then key . cache_version . to_param
703- when key . is_a? ( Array ) then key . map { |element | expanded_version ( element ) } . compact . to_param
697+ when key . is_a? ( Array ) then key . map { |element | expanded_version ( element ) } . tap ( & : compact! ) . to_param
704698 when key . respond_to? ( :to_a ) then expanded_version ( key . to_a )
705699 end
706700 end
You can’t perform that action at this time.
0 commit comments