Skip to content

Commit

Permalink
Merge pull request #21100 from bquorning/route-set
Browse files Browse the repository at this point in the history
Use #start_with? and #[] for speed
  • Loading branch information
schneems committed Aug 2, 2015
2 parents 1c91212 + 113f8a6 commit 61ed2b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions actionpack/lib/action_dispatch/routing/route_set.rb
Expand Up @@ -676,8 +676,8 @@ def use_relative_controller!
# Remove leading slashes from controllers
def normalize_controller!
if controller
if m = controller.match(/\A\/(?<controller_without_leading_slash>.*)/)
@options[:controller] = m[:controller_without_leading_slash]
if controller.start_with?("/".freeze)
@options[:controller] = controller[1..-1]
else
@options[:controller] = controller
end
Expand Down

0 comments on commit 61ed2b3

Please sign in to comment.