提交 948ed346 编写于 作者: C Clemens Kofler 提交者: Jeremy Kemper

Some performance goodness for routing.

Signed-off-by: NJeremy Kemper <jeremy@bitsweat.net>
上级 ba3ecf53
...@@ -160,7 +160,7 @@ def extraction_code ...@@ -160,7 +160,7 @@ def extraction_code
s << "\n#{expiry_statement}" s << "\n#{expiry_statement}"
end end
def interpolation_chunk(value_code = "#{local_name}") def interpolation_chunk(value_code = local_name)
"\#{URI.escape(#{value_code}.to_s, ActionController::Routing::Segment::UNSAFE_PCHAR)}" "\#{URI.escape(#{value_code}.to_s, ActionController::Routing::Segment::UNSAFE_PCHAR)}"
end end
...@@ -231,7 +231,7 @@ def regexp_chunk ...@@ -231,7 +231,7 @@ def regexp_chunk
end end
# Don't URI.escape the controller name since it may contain slashes. # Don't URI.escape the controller name since it may contain slashes.
def interpolation_chunk(value_code = "#{local_name}") def interpolation_chunk(value_code = local_name)
"\#{#{value_code}.to_s}" "\#{#{value_code}.to_s}"
end end
...@@ -251,7 +251,7 @@ def match_extraction(next_capture) ...@@ -251,7 +251,7 @@ def match_extraction(next_capture)
end end
class PathSegment < DynamicSegment #:nodoc: class PathSegment < DynamicSegment #:nodoc:
def interpolation_chunk(value_code = "#{local_name}") def interpolation_chunk(value_code = local_name)
"\#{#{value_code}}" "\#{#{value_code}}"
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册