diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-23 09:00:05 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-23 09:00:05 +0000 |
commit | b366dbd952417a610913e05ad58024b7da03fdb8 (patch) | |
tree | 0ca8e594c78a92cec73ca0abec49fec90d8373e3 /actionpack/lib/action_controller/filters.rb | |
parent | d1725929852ab9da48f7ff7c4fa7f401ac55c331 (diff) | |
download | rails-b366dbd952417a610913e05ad58024b7da03fdb8.tar.gz rails-b366dbd952417a610913e05ad58024b7da03fdb8.tar.bz2 rails-b366dbd952417a610913e05ad58024b7da03fdb8.zip |
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
Diffstat (limited to 'actionpack/lib/action_controller/filters.rb')
-rw-r--r-- | actionpack/lib/action_controller/filters.rb | 16 |
1 files changed, 8 insertions, 8 deletions
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 <tt>filters</tt> 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 <tt>filters</tt> 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) |