Skip to content

Commit

Permalink
Hash#empty? is faster than Enumerable#any? when used on a Hash.
Browse files Browse the repository at this point in the history
  • Loading branch information
thedarkone committed Sep 27, 2010
1 parent 7035766 commit 5b81d1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch/routing/route_set.rb
Expand Up @@ -443,7 +443,7 @@ def generate


return [path, params.keys] if @extras return [path, params.keys] if @extras


path << "?#{params.to_query}" if params.any? path << "?#{params.to_query}" unless params.empty?
path path
rescue Rack::Mount::RoutingError rescue Rack::Mount::RoutingError
raise_routing_error raise_routing_error
Expand Down

0 comments on commit 5b81d1f

Please sign in to comment.