Permalink
Browse files

Merge pull request #15310 from tgxworld/small_refactor_get_routes_as_…

…head

Remove unnecessary flatten! method call.
  • Loading branch information...
2 parents 6c30717 + 586c346 commit 2926a9af8794a6cafde43bfafc023b2adb62be03 @carlosantoniodasilva carlosantoniodasilva committed May 25, 2014
Showing with 1 addition and 3 deletions.
  1. +1 −3 actionpack/lib/action_dispatch/journey/router.rb
View
4 actionpack/lib/action_dispatch/journey/router.rb
@@ -115,7 +115,7 @@ def find_routes req
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 @@ def get_routes_as_head(routes)
route.precedence = r.precedence + precedence
end
}
- routes.flatten!
- routes
end
end
end

0 comments on commit 2926a9a

Please sign in to comment.