From 586c346059f263aa72242a61f863396c56181c8f Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Sun, 25 May 2014 00:15:24 -0700 Subject: Remove unnecessary flatten! method call. --- actionpack/lib/action_dispatch/journey/router.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_dispatch/journey/router.rb b/actionpack/lib/action_dispatch/journey/router.rb index 2ead6a4eb3..c0317e3ad2 100644 --- a/actionpack/lib/action_dispatch/journey/router.rb +++ b/actionpack/lib/action_dispatch/journey/router.rb @@ -115,7 +115,7 @@ module ActionDispatch def get_routes_as_head(routes) precedence = (routes.map(&:precedence).max || 0) + 1 - routes = routes.select { |r| + routes.select { |r| r.verb === "GET" && !(r.verb === "HEAD") }.map! { |r| Route.new(r.name, @@ -126,8 +126,6 @@ module ActionDispatch route.precedence = r.precedence + precedence end } - routes.flatten! - routes end end end -- cgit v1.2.3