Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
cache path parts in the instance
  • Loading branch information
tenderlove committed Jan 30, 2013
1 parent 8e5b437 commit c337e87
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions actionpack/lib/action_dispatch/routing/route_set.rb
Expand Up @@ -163,7 +163,8 @@ class OptimizedUrlHelper < UrlHelper

def initialize(route, options)
super
@arg_size = @route.required_parts.size
@path_parts = @route.required_parts
@arg_size = @path_parts.size
end

def call(t, args)
Expand All @@ -185,7 +186,7 @@ def optimized_helper(args)
true
end

@route.required_parts.each_with_index do |part, i|
@path_parts.each_with_index do |part, i|
# Replace each route parameter
# e.g. :id for regular parameter or *path for globbing
# with ruby string interpolation code
Expand Down

0 comments on commit c337e87

Please sign in to comment.