From b366dbd952417a610913e05ad58024b7da03fdb8 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 23 Jul 2005 09:00:05 +0000 Subject: Improved performance with 5-30% through a series of Action Pack optimizations #1811 [Stefan Kaes] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1905 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/filters.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'actionpack/lib/action_controller/filters.rb') diff --git a/actionpack/lib/action_controller/filters.rb b/actionpack/lib/action_controller/filters.rb index f3999a853e..a36370e969 100644 --- a/actionpack/lib/action_controller/filters.rb +++ b/actionpack/lib/action_controller/filters.rb @@ -157,7 +157,7 @@ module ActionController #:nodoc: conditions = extract_conditions!(filters) filters << block if block_given? add_action_conditions(filters, conditions) - append_filter_to_chain("before", filters) + append_filter_to_chain('before', filters) end # The passed filters will be prepended to the array of filters that's run _before_ actions @@ -166,7 +166,7 @@ module ActionController #:nodoc: conditions = extract_conditions!(filters) filters << block if block_given? add_action_conditions(filters, conditions) - prepend_filter_to_chain("before", filters) + prepend_filter_to_chain('before', filters) end # Short-hand for append_before_filter since that's the most common of the two. @@ -178,7 +178,7 @@ module ActionController #:nodoc: conditions = extract_conditions!(filters) filters << block if block_given? add_action_conditions(filters, conditions) - append_filter_to_chain("after", filters) + append_filter_to_chain('after', filters) end # The passed filters will be prepended to the array of filters that's run _after_ actions @@ -272,8 +272,8 @@ module ActionController #:nodoc: def add_action_conditions(filters, conditions) return unless conditions included, excluded = conditions[:only], conditions[:except] - write_inheritable_hash("included_actions", condition_hash(filters, included)) && return if included - write_inheritable_hash("excluded_actions", condition_hash(filters, excluded)) if excluded + write_inheritable_hash('included_actions', condition_hash(filters, included)) && return if included + write_inheritable_hash('excluded_actions', condition_hash(filters, excluded)) if excluded end def condition_hash(filters, *actions) @@ -322,7 +322,7 @@ module ActionController #:nodoc: else raise( ActionControllerError, - "Filters need to be either a symbol, proc/method, or class implementing a static filter method" + 'Filters need to be either a symbol, proc/method, or class implementing a static filter method' ) end @@ -334,11 +334,11 @@ module ActionController #:nodoc: end def filter_block?(filter) - filter.respond_to?("call") && (filter.arity == 1 || filter.arity == -1) + filter.respond_to?('call') && (filter.arity == 1 || filter.arity == -1) end def filter_class?(filter) - filter.respond_to?("filter") + filter.respond_to?('filter') end def action_exempted?(filter) -- cgit v1.2.3