Skip to content
Browse files

Hash#empty? is faster than Enumerable#any? when used on a Hash.

  • Loading branch information...
1 parent 7035766 commit 5b81d1f3ef1f1b06495eadcc1c2d110d76ac1de3 @thedarkone thedarkone committed Sep 27, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 actionpack/lib/action_dispatch/routing/route_set.rb
View
2 actionpack/lib/action_dispatch/routing/route_set.rb
@@ -443,7 +443,7 @@ def generate
return [path, params.keys] if @extras
- path << "?#{params.to_query}" if params.any?
+ path << "?#{params.to_query}" unless params.empty?
path
rescue Rack::Mount::RoutingError
raise_routing_error

0 comments on commit 5b81d1f

Please sign in to comment.
Something went wrong with that request. Please try again.